Hi there!
After spending almost 2 hour browsing the net searching for
anything that wold solve my problem I decided to ask big
brains for help. ;o)
Anyone can help me with these windows dialogs? I need to put
a simple file requester into my program.
I believe it's easy. But I've just started. I will thankfuly
accept any ideas or suggestions.
Reunion
Comments
:
: After spending almost 2 hour browsing the net searching for
: anything that wold solve my problem I decided to ask big
: brains for help. ;o)
:
: Anyone can help me with these windows dialogs? I need to put
: a simple file requester into my program.
:
: I believe it's easy. But I've just started. I will thankfuly
: accept any ideas or suggestions.
:
: Reunion
:
:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/hh/winui/commdlg3_3cbp.asp
[code]
char filebuffer[256];
OPENFILENAME ofn;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = ParenthWnd; //Parent window handle!
ofn.lpstrFilter = "Text Files *.TXT All Files *.* ";
ofn.nFilterIndex = 1;
ofn.lpstrFile = filebuffer;
ofn.nMaxFile = sizeof(filebuffer);
ofn.lpstrInitialDir = "C:\Windows";
ofn.lpstrTitle = "My Open Dialog!";
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST;
if(GetOpenFileName(&ofn) == NULL)
{
//Handle CANCEL or errors here
}
//Now filbuffer contains the full drive, path, and filename of the file you selected!
[/code]
If you have any questions, feel free to ask.
-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red]
I finaly got IT!
take care
Reunion