Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
file selector in windows application Posted by reunion on 17 Jul 2001 at 6:06 PM
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


Report
Re: file selector in windows application Posted by AsmGuru62 on 17 Jul 2001 at 6:52 PM
: 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
:
:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/hh/winui/commdlg3_3cbp.asp



Report
Re: file selector in windows application Posted by Sephiroth on 17 Jul 2001 at 7:11 PM
And if that doesn't help, try this code out:
char filebuffer[256];
OPENFILENAME ofn;

ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = ParenthWnd; //Parent window handle!
ofn.lpstrFilter = "Text Files\0*.TXT\0All Files\0*.*\0";
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!

If you have any questions, feel free to ask.

-Sephiroth


Report
Thanks Posted by reunion on 19 Jul 2001 at 2:57 PM
Many thanks to both of you guys ;o)

I finaly got IT!

take care

Reunion




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.