well im trying to create a notepad in the win32 Api with C++ and at the moment im trying to set up the Open and Save As dialogs but the open Dialog works and the Save As doesn't, yet when i comment out the Open Dialog the Save Dialog works
Im using dev C++
Heres the code:
case IDM_OPEN:
//Open Dialog
OPENFILENAME openFileDialog;
char szFileName[MAX_PATH];
ZeroMemory(&openFileDialog, sizeof(openFileDialog));
openFileDialog.lStructSize= sizeof(openFileDialog);
openFileDialog.hwndOwner = hwnd;
openFileDialog.lpstrFilter = "Demonic Text (*.Dtxt)\0*.Dtxt\0Text Files (*.txt)\0*txt\0All Files (*.*)\0*.*\0";
openFileDialog.lpstrFile = szFileName;
openFileDialog.nMaxFile = MAX_PATH;
openFileDialog.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
openFileDialog.lpstrDefExt = "Dtxt";
if(GetOpenFileName(&openFileDialog)){
}
break;
case IDM_SAVE:
break;
case IDM_SAVE_AS:
//Save Dialog
OPENFILENAME saveFileDialog;
char szSaveFileName[MAX_PATH];
ZeroMemory(&saveFileDialog, sizeof(saveFileDialog));
saveFileDialog.lStructSize= sizeof(saveFileDialog);
saveFileDialog.hwndOwner = hwnd;
saveFileDialog.lpstrFilter = "Demonic Text (*.Dtxt)\0*.Dtxt\0Text Files (*.txt)\0*txt\0All Files (*.*)\0*.*\0";
saveFileDialog.lpstrFile = szSaveFileName;
saveFileDialog.nMaxFile = MAX_PATH;
saveFileDialog.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY |OFN_OVERWRITEPROMPT;
saveFileDialog.lpstrDefExt = "Dtxt";
if(GetSaveFileName(&saveFileDialog)){
}
break;