Nikolay Sivov : comdlg32: Simplify notification helper.
Alexandre Julliard
julliard at winehq.org
Wed May 31 16:20:17 CDT 2017
Module: wine
Branch: master
Commit: c4b133e231bb5e32814b35f9a5cd3ba930570aff
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4b133e231bb5e32814b35f9a5cd3ba930570aff
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed May 31 06:16:01 2017 +0300
comdlg32: Simplify notification helper.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/comdlg32/filedlg.c | 49 ++++++++++++++++++++-----------------------------
1 file changed, 20 insertions(+), 29 deletions(-)
diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index da85260..fa4a0d0 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -853,38 +853,29 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
{
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg);
- LRESULT hook_result = 0;
+ LRESULT hook_result;
+ OFNOTIFYW ofnNotify;
- TRACE("%p 0x%04x\n",hwndParentDlg, uCode);
+ TRACE("%p %d\n", hwndParentDlg, uCode);
- if(!fodInfos) return 0;
+ if (!fodInfos || !fodInfos->DlgInfos.hwndCustomDlg)
+ return 0;
+
+ TRACE("CALL NOTIFY for %d\n", uCode);
+
+ ofnNotify.hdr.hwndFrom = hwndParentDlg;
+ ofnNotify.hdr.idFrom = 0;
+ ofnNotify.hdr.code = uCode;
+ ofnNotify.lpOFN = fodInfos->ofnInfos;
+ ofnNotify.pszFile = NULL;
+
+ if (fodInfos->unicode)
+ hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
+ else
+ hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
+
+ TRACE("RET NOTIFY retval %#lx\n", hook_result);
- if(fodInfos->DlgInfos.hwndCustomDlg)
- {
- TRACE("CALL NOTIFY for %x\n", uCode);
- if(fodInfos->unicode)
- {
- OFNOTIFYW ofnNotify;
- ofnNotify.hdr.hwndFrom=hwndParentDlg;
- ofnNotify.hdr.idFrom=0;
- ofnNotify.hdr.code = uCode;
- ofnNotify.lpOFN = fodInfos->ofnInfos;
- ofnNotify.pszFile = NULL;
- hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
- }
- else
- {
- OFNOTIFYA ofnNotify;
- ofnNotify.hdr.hwndFrom=hwndParentDlg;
- ofnNotify.hdr.idFrom=0;
- ofnNotify.hdr.code = uCode;
- ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
- ofnNotify.pszFile = NULL;
- hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
- }
- TRACE("RET NOTIFY\n");
- }
- TRACE("Retval: 0x%08lx\n", hook_result);
return hook_result;
}
More information about the wine-cvs
mailing list