File open / save dialog
I am trying to browse a directory in the Open / Save File dialog box. I could get the handle of the general dialog as well as its control window. But I don’t know how to specify the file name and click “Save / Open” button to save / open the file. I could not find the SendMessage options required to complete these steps. Any suggestions?
a source to share
I am assuming you are trying to control another application and why you are getting a window handle etc.
If so, you can use SendKeys to send Alt-N to select the name field, then the filename, then Alt-S to hit save.
If you are just trying to use the Open or Save dialog in your own program, then you should use the built-in components OpenFileDialog and SaveFileDialog.
a source to share
Why are you using SendMessage? Why not use built-in classes OpenFileDialog
and SaveFileDialog
?
See here for more details OpenFileDialog
:
http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx
a source to share