Save vs Save As.... OPENFILENAME flags
Sometimes you don't need to Save As perhaps just wanna save to default/existing file..
My DoFileSave() function which saves data to a file looks as follows
Code:
// File save dialog
void DoFileSave(HWND hwnd)
{
OPENFILENAME ofn;
char szFileName[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Binary Files (*.dat)\0*.dat\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "dat";
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
if(GetSaveFileName(&ofn))
{
WriteToFile(hwnd);
}
}
What do i change in Flag (or this function) to prevent Save Save dialog box.. I'm adding both Save As & Save on the menu but do not know how to handle Save...