Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
#include "ltwrappr.h"
virtual L_INT LDialogFile::DoModalGetDirectory(hWndOwner)
HWND hWndOwner; |
/* handle of the window which owns the dialog */ |
Displays the Get Directory dialog box, and allows the user to browse the file system for a folder or directory.
Parameter |
Description |
hWndOwner |
Handle of the window which owns the dialog. |
Returns
SUCCESS_DLG_OK |
The "OK" button was pressed, and the dialog exited successfully. |
SUCCESS_DLG_CANCEL |
The "Cancel" button was pressed, and the dialog exited successfully. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
LDialogFile::SetDirectoryParams must be called before using this function to set the initial values for the dialog. You can get the updated GETDIRECTORYDLGPARAMS with the values entered by the user through the dialog by using LDialogFile::GetDirectoryParams.
Required DLLs and Libraries
LTDLGFILE For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Example
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName L_INT LDialogFile_DoModalGetDirectoryExample(LBitmap * pBitmap, HWND hWnd) { L_INT nRet; LDialogFile DlgFile; nRet = LDialogFile::Initialize (0); if(nRet != SUCCESS) return nRet; DlgFile.SetBitmap (pBitmap); GETDIRECTORYDLGPARAMS DlgParams; L_TCHAR szDirectory [ L_MAXPATH ]; memset ( &DlgParams, 0, sizeof ( GETDIRECTORYDLGPARAMS ) ) ; lstrcpy ( szDirectory, MAKE_IMAGE_PATH(TEXT(""))) ; DlgParams.uStructSize = sizeof ( GETDIRECTORYDLGPARAMS ) ; DlgParams.pszDirectory = szDirectory ; DlgParams.nBuffSize = L_MAXPATH ; DlgParams.pszFilter = TEXT("ALL\0*.*\0LEAD\0*.cmp\0JPEG\0*.JPG\0") ; DlgParams.nFilterIndex = 1 ; DlgParams.pszTitle = TEXT("Select a Directory Please"); DlgFile.EnableCallBack (FALSE); DlgFile.EnablePreview(TRUE); DlgFile.EnableAutoProcess (TRUE); DlgFile.EnableToolbar(TRUE); nRet = DlgFile.SetDirectoryParams(&DlgParams) ; if(nRet != SUCCESS) return nRet; nRet = DlgFile.DoModalGetDirectory(hWnd); if(nRet < 1) return nRet; // Gets the updated values for the structure nRet = DlgFile.GetDirectoryParams (&DlgParams, sizeof(DlgParams)) ; if(nRet != SUCCESS) return nRet; nRet = LDialogFile::Free (); if(nRet != SUCCESS) return nRet; return SUCCESS; }