Commit 0a5b6c85 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

comdlg32: Implement OFN_CREATEPROMPT checking.

parent deadc6cf
......@@ -36,7 +36,7 @@
*
* FIXME: add to recent docs
*
* FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT,
* FIXME: flags not implemented: OFN_DONTADDTORECENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING,
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
* OFN_NOTESTFILECREATE, OFN_USEMONIKERS
......@@ -83,7 +83,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define UNIMPLEMENTED_FLAGS \
(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
(OFN_DONTADDTORECENT |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING |\
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/)
......@@ -2118,6 +2118,24 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
}
/* In Open dialog: check if it should be created if it doesn't exist */
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
&& fodInfos->ofnInfos->Flags & OFN_CREATEPROMPT
&& !PathFileExistsW(lpstrPathAndFile))
{
WCHAR lpstrCreate[100];
int answer;
LoadStringW(COMDLG32_hInstance, IDS_CREATEFILE, lpstrCreate, 100);
answer = MessageBoxW(hwnd, lpstrCreate, fodInfos->title,
MB_YESNO | MB_ICONEXCLAMATION);
if (answer == IDNO)
{
ret = FALSE;
goto ret;
}
}
/* Check that the size of the file does not exceed buffer size.
(Allow for extra \0 if OFN_MULTISELECT is set.) */
if(lstrlenW(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment