[Dev-C++] RE: Create Dialog Box on Demand
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ma...@du...> - 2001-08-07 14:21:28
|
Christian,
First you need to fill an OPENFILENAME structure eg.
OPENFILENAME ofn;
char szFileName[MAX_PATH];
ZeroMemory(&ofn, sizeof(ofn));
szFileName[0] = 0;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp\0All
Files (*.*)\0*.*\0\0"; /* Filters seperated by null */
ofn.lpstrFile = szFileName;
/* File Name holder */
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST |
OFN_HIDEREADONLY ;
ofn.lpstrDefExt = "bmp";
Then call it using GetOpenFileName(&ofn)
szFileName will contain the full path and filename if the user selected
a file and OK.
Regards,
Mark Ballard
ma...@du...
|