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

#include <uLib/StdDlg.h>

Inheritance diagram for DirDialog:

Detailed Description

Standard Directory selection dialog..

DirDialog encapsulates and enhances the shell's directory selection dialog.
The inherited lParam member is reserved for it's _Hook, so you must not use it.
pData is provided as a replacement field for your application to use.

Note: You should call InitShellFunc() before using DirDialog methods.
The constructor has no such limitation, so it can be used globally.

See also [MSDN] BROWSEINFO, SHBrowseForFolder()

Definition at line 311 of file StdDlg.h.

Public Data

LPITEMIDLIST pIdl
 
TCHAR Folder [MAX_PATH]
 
PVOID pData
 

Static Public Attributes

static CCSTR DefaultTitle
 
static IFolderFilter * FolderFilter = NULL
 

Public Functions

 DirDialog (HWND Owner=NULL, UINT Flags=(BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE|BIF_EDITBOX))
 
void SetOwner (HWND Owner)
 
void Done ()
 
 ~DirDialog ()
 
bool SetInitialDir (CSTR Dir)
 
void SetRoot (LPITEMIDLIST pidl)
 
bool SetRootCsid (int csId)
 
bool SetRootDir (CSTR Dir)
 
bool Execute ()
 

Static Protected Member Functions

static UINT_PTR CALLBACK _Hook (HWND hwnd, UINT msg, LPARAM lp, LPARAM data)
 

Protected Attributes

IFolderFilterSite * pFilterSite
 

Constructor & Destructor Documentation

◆ DirDialog()

DirDialog::DirDialog ( HWND  Owner = NULL,
UINT  Flags = (BIF_RETURNONLYFSDIRS| BIF_NEWDIALOGSTYLE| BIF_EDITBOX) 
)

Definition at line 406 of file StdDlg.cpp.

◆ ~DirDialog()

DirDialog::~DirDialog ( )

Definition at line 433 of file StdDlg.cpp.

Member Function Documentation

◆ SetOwner()

void DirDialog::SetOwner ( HWND  Owner)

Who should be notified...

Definition at line 462 of file StdDlg.cpp.

◆ Done()

void DirDialog::Done ( )

Dispose of non-NULL PIDL members, et c...

Definition at line 438 of file StdDlg.cpp.

◆ SetInitialDir()

bool DirDialog::SetInitialDir ( CSTR  Dir)

Set initially selected item.

Definition at line 467 of file StdDlg.cpp.

◆ SetRoot()

void DirDialog::SetRoot ( LPITEMIDLIST  pidl)

Set root by PIDL. See [MSDN] BROWSEINFO::pidlRoot

Definition at line 479 of file StdDlg.cpp.

◆ SetRootCsid()

bool DirDialog::SetRootCsid ( int  csId)

Set root by a CSIDL. See [MSDN] SHGetSpecialFolderLocation

Definition at line 485 of file StdDlg.cpp.

◆ SetRootDir()

bool DirDialog::SetRootDir ( CSTR  Dir)

Set root by a dir path. See GetPathNamePIDL

Definition at line 495 of file StdDlg.cpp.

◆ Execute()

bool DirDialog::Execute ( )

Execute the shell's directory selection dialog.

When Execute returns 'true', the selected directory is returned
in both Folder and pIdl, for the sake of convenience.

Definition at line 503 of file StdDlg.cpp.

◆ _Hook()

DLGHOOKPROC DirDialog::_Hook ( HWND  hwnd,
UINT  msg,
LPARAM  lp,
LPARAM  data 
)
staticprotected

DirDialog's BFFCALLBACK function..

This is used to activate your (optional) FolderFilter, and to clean up at dialog's end.
NOTE: If you should need additional hook processing, you should call this
from your own hook function, and not use BROWSEINFO::lParam (use pData instead).
The hook function recieves a PDirDialog as it's data parameter.

Definition at line 520 of file StdDlg.cpp.

Member Data Documentation

◆ pIdl

LPITEMIDLIST DirDialog::pIdl

Selected folder, as PIDL.

Definition at line 321 of file StdDlg.h.

◆ Folder

TCHAR DirDialog::Folder[MAX_PATH]

Selected folder, as string.

Definition at line 322 of file StdDlg.h.

◆ pData

PVOID DirDialog::pData

Arbitrary. Replacement for the reserved lParam.

Definition at line 323 of file StdDlg.h.

◆ DefaultTitle

CCSTR DirDialog::DefaultTitle
static
Initial value:
=
_T("or click [Cancel] to abort the operation.")

Default caption for lpszTitle.

Definition at line 325 of file StdDlg.h.

◆ FolderFilter

IFolderFilter * DirDialog::FolderFilter = NULL
static

Optional IFolderFilter.

Definition at line 326 of file StdDlg.h.

◆ pFilterSite

IFolderFilterSite* DirDialog::pFilterSite
protected

Definition at line 346 of file StdDlg.h.


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