uLib  User mode C/C++ extended API library for Win32 programmers.
FileDialog Class Reference

#include <uLib/StdDlg.h>

Inheritance diagram for FileDialog:

Detailed Description

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()

Definition at line 91 of file StdDlg.h.

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)
 

Constructor & Destructor Documentation

◆ FileDialog()

FileDialog::FileDialog ( HWND  owner = NULL)

Definition at line 85 of file StdDlg.cpp.

◆ ~FileDialog()

FileDialog::~FileDialog ( )

Definition at line 116 of file StdDlg.cpp.

Member Function Documentation

◆ SetOwner()

void FileDialog::SetOwner ( HWND  owner,
HINSTANCE  hInst = NULL 
)

Definition at line 109 of file StdDlg.cpp.

◆ Execute()

bool FileDialog::Execute ( UINT  mode)

Execute the standard file selection dialog.

Parameters
ModeOne of FDLG_OPEN or FDLG_SAVE

Definition at line 119 of file StdDlg.cpp.

◆ Name()

CSTR FileDialog::Name ( )

Get a ptr to the 'filename.ext' part of FullName.

Definition at line 167 of file StdDlg.cpp.

◆ Ext()

CSTR FileDialog::Ext ( )

Get a ptr to the '.ext' part of FullName.

Definition at line 172 of file StdDlg.cpp.

◆ ForEach()

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.

◆ PickFile()

CSTR FileDialog::PickFile ( HWND  owner,
CSTR  caption,
CSTR  filter 
)

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()

CSTR FileDialog::SetFilename ( CSTR  PathName)

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.

Member Data Documentation

◆ FullName

TCHAR FileDialog::FullName[MAX_PATH]

Buffer that recieves the full pathname.

Definition at line 114 of file StdDlg.h.

◆ InitDir

TCHAR FileDialog::InitDir[MAX_PATH]

Initial directory. (optional)

Definition at line 116 of file StdDlg.h.


The documentation for this class was generated from the following files: