Click to See Complete Forum and Search --> : Suggesting a name in the File Dialog
April 24th, 1999, 07:57 PM
Hi
I was wondering if somebody could tell me how to "suggest" a name to the File Dialog each time it opens up. What I mean by "suggest" is when the File Dialog Box opens up there is already a name there for the user to save as, if he or she wants to use.
Thanks
Joe Farkas
April 24th, 1999, 10:14 PM
If your filedialog box uses an edit window to input the file name, you could use
((CEdit*)GetDlgItem(IDC_EDIT1))->SetWindowText(filename); //Set filepath test to Edit 1 edit box
If it doesn't, tell me what is the input window type, and I wil try to help you.
Joe Farkas
farkas_3@msn.com
farkas-j@grayson.com
April 24th, 1999, 10:45 PM
Thanks for replying Joe, but actually I was just using the windows default File Dialog:
CFileDialog dlg(FALSE);
Is there any way I could have a name for the file to be saved as it already in using the CFileDialog like so up above?
Thanks
Rail Jon Rogut
April 24th, 1999, 10:51 PM
Look up CFileDialog in the Help...
The third parameter can be a default file name....
CString m_szNewEDLName = "MyFileName.ext";
CFileDialog dlg(FALSE, _T("ext"), m_szNewEDLName, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, _T("(Your file type) Files (*.ext)|*.ext|All Files (*.*)|*.*||"));
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.