I am trying to make a prompt for Opening/Saving Files with ifstream/ofstream.
If any can help I'd appreciate it.
Printable View
I am trying to make a prompt for Opening/Saving Files with ifstream/ofstream.
If any can help I'd appreciate it.
I'm not sure what you mean. Are using the Win32 API or are you just making a console application? There are common controls for saving and opening files in the Win32 API or you can simply output some text requesting the file name to save or open if you are in console mode. Please elaborate on the situation.
I am using Win32 API
Then you want to lookup two functions:
Opening a file:
Saving a file:Code:BOOL GetOpenFileName( LPOPENFILENAME lpofn );
The structure OPENFILENAME can be a little tricky to fill in at first. If you need help let me know.Code:BOOL GetSaveFileName( LPOPENFILENAME lpofn );
Thanks that helped a lot.
But now i can't figure out how to ungrey the close button in the menu...
Ungrey the close button? What are you talking about?
I disabled a button (not clickable) and want it enabled (Clickable) when a file is opened.
Check it out yo.
Code:BOOL EnableWindow( HWND hWnd, BOOL bEnable );
I can't seem to figure out how that works..
Well you have an hwnd for your button right? If not, get it by using the function GetDlgItem( ). It takes 2 parameters, the first is the hwnd to your main dialog and the second is the identifier of the button. Something like IDC_BUTTON_1. Once you have the hwnd to your button, then call EnableWindow with that hwnd and FALSE or TRUE depending on whether you want it enabled or not.
Thanks a lot for your help!