comdlg32: Simplify notification helper.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-05-31 06:16:01 +03:00 committed by Alexandre Julliard
parent d93ae6ff34
commit c4b133e231
1 changed files with 20 additions and 29 deletions

View File

@ -853,38 +853,29 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd)
LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode) LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
{ {
FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg); FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg);
LRESULT hook_result = 0; LRESULT hook_result;
TRACE("%p 0x%04x\n",hwndParentDlg, uCode);
if(!fodInfos) return 0;
if(fodInfos->DlgInfos.hwndCustomDlg)
{
TRACE("CALL NOTIFY for %x\n", uCode);
if(fodInfos->unicode)
{
OFNOTIFYW ofnNotify; OFNOTIFYW ofnNotify;
ofnNotify.hdr.hwndFrom=hwndParentDlg;
ofnNotify.hdr.idFrom=0; TRACE("%p %d\n", hwndParentDlg, uCode);
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.hdr.code = uCode;
ofnNotify.lpOFN = fodInfos->ofnInfos; ofnNotify.lpOFN = fodInfos->ofnInfos;
ofnNotify.pszFile = NULL; ofnNotify.pszFile = NULL;
hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
} if (fodInfos->unicode)
hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
else else
{ hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
OFNOTIFYA ofnNotify;
ofnNotify.hdr.hwndFrom=hwndParentDlg; TRACE("RET NOTIFY retval %#lx\n", hook_result);
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; return hook_result;
} }