Click to See Complete Forum and Search --> : File OPen Dialog


Fandu_Nagesh
July 27th, 2002, 12:05 AM
Hi Gurus
I am using following code for File Open Dialog.

OPENFILENAME ofn;
char szFile[1024]= "\0";
HANDLE hf;
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lpstrTitle = dialogTitle;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetForegroundWindow();
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = fileType;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.lpstrInitialDir = defaultFolder;
ofn.nMaxFileTitle = 1;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

if (GetOpenFileName(&ofn)==FALSE)
{
return 0;
}
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);

strcpy(FolderPathName,ofn.lpstrFile);
CloseHandle(hf);

my problem is CAN I SHOW MY OWN STRING ON THIS STANDARD DIALOG?.....as per my understanding you can only change the header of this dialog. but for my application i want to add one string on this dialog?.....

Plz reply to this post.... if possibel with code
Regards
nagesh

stober
July 27th, 2002, 05:55 AM
CAN I SHOW MY OWN STRING ON THIS STANDARD DIALOG?.....


What string? Do you want to add a custom static label to display some other information ? Or customize the way the file names are displayed ? Did you read the MSDN articles about Explorer-Style Custom Templates

Fandu_Nagesh
July 27th, 2002, 06:31 AM
Hi Stober
Thanx for repling....well Sir i want to show custom static label to display some information on the dialog. Thats the main thing i want to do .....
Please Help me to sort out this problem............
Regards
Nagesh:confused: :confused:

stober
July 28th, 2002, 01:38 AM
As far as I know you cannot modify its dialog box directly, but you can create another dialog box that is appended to the bottom of theirs to extend its functionality. There is an example of doing that on the MSDN CD #1 that comes with the VC6 compiler. Look in the \examples directory.