|
uLib
User mode C/C++ extended API library for Win32 programmers.
|
#include <uLib/StdDlg.h>
FileDialog is an enhanced Open/Save file dialog.
The dialog is invoked with an Execute() call for either FDLG_OPEN or FDLG_SAVE.
FullName receives the full pathname if Execute() returns true.
The FDLG_OPEN mode supports multiple file selection, each of which are easily
processed with the ForEach() iterator and a suitable callback function.
The FDLG_SAVE mode is always single selection (naturally).
See also [MSDN} OPENFILENAME, GetOpenFileName(), GetSaveFileName()
Public Data | |
| TCHAR | FullName [MAX_PATH] |
| TCHAR | InitDir [MAX_PATH] |
Public Functions | |
| FileDialog (HWND owner=NULL) | |
| void | SetOwner (HWND owner, HINSTANCE hInst=NULL) |
| ~FileDialog () | |
| bool | Execute (UINT mode) |
| CSTR | Name () |
| CSTR | Ext () |
| bool | ForEach (FDLG_ItemProc Action, PVOID UserData) |
| CSTR | PickFile (HWND owner, CSTR caption, CSTR filter) |
| CSTR | SetFilename (CSTR PathName) |
| FileDialog::FileDialog | ( | HWND | owner = NULL | ) |
Definition at line 85 of file StdDlg.cpp.
| FileDialog::~FileDialog | ( | ) |
Definition at line 116 of file StdDlg.cpp.
| void FileDialog::SetOwner | ( | HWND | owner, |
| HINSTANCE | hInst = NULL |
||
| ) |
Definition at line 109 of file StdDlg.cpp.
| bool FileDialog::Execute | ( | UINT | mode | ) |
Execute the standard file selection dialog.
Definition at line 119 of file StdDlg.cpp.
| CSTR FileDialog::Name | ( | ) |
Get a ptr to the 'filename.ext' part of FullName.
Definition at line 167 of file StdDlg.cpp.
| CSTR FileDialog::Ext | ( | ) |
Get a ptr to the '.ext' part of FullName.
Definition at line 172 of file StdDlg.cpp.
| bool FileDialog::ForEach | ( | FDLG_ItemProc | Action, |
| PVOID | UserData | ||
| ) |
ForEach() performs multi-selection enumeration.
Each selected file is passed, with full pathname, to your Action callback.
Definition at line 209 of file StdDlg.cpp.
Pick a single file to open.
Use this in situations where you don't want to allow multiple selection.
Definition at line 141 of file StdDlg.cpp.
SetFilename pokes a new path & name into FullName
and updates the OPENFILENAME fields to match the new pathname.
Definition at line 177 of file StdDlg.cpp.
| TCHAR FileDialog::FullName[MAX_PATH] |
| TCHAR FileDialog::InitDir[MAX_PATH] |