From 76dcb0ecb9c64a949314efa30ce32a29f3ba7b65 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 13 Nov 2009 11:11:31 +0100 Subject: [PATCH] user32: Reimplement DefDlgProc16 using message mapping functions. --- dlls/user32/defdlg.c | 55 +--------------------------------------------------- dlls/user32/msg16.c | 18 +++++++++++++++++ 2 files changed, 19 insertions(+), 54 deletions(-) diff --git a/dlls/user32/defdlg.c b/dlls/user32/defdlg.c index 609689059ce..e57dae946c9 100644 --- a/dlls/user32/defdlg.c +++ b/dlls/user32/defdlg.c @@ -23,7 +23,7 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" -#include "wine/winuser16.h" +#include "winuser.h" #include "controls.h" #include "win.h" #include "user_private.h" @@ -374,59 +374,6 @@ out: } /*********************************************************************** - * DefDlgProc (USER.308) - */ -LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, - LPARAM lParam ) -{ - DIALOGINFO *dlgInfo; - DLGPROC16 dlgproc; - HWND hwnd32 = WIN_Handle32( hwnd ); - BOOL result = FALSE; - - /* Perform DIALOGINFO initialization if not done */ - if(!(dlgInfo = DIALOG_get_info(hwnd32, TRUE))) return 0; - - SetWindowLongPtrW( hwnd32, DWLP_MSGRESULT, 0 ); - - if ((dlgproc = (DLGPROC16)DEFDLG_GetDlgProc( hwnd32 ))) /* Call dialog procedure */ - result = WINPROC_CallDlgProc16( dlgproc, hwnd, msg, wParam, lParam ); - - if (!result && IsWindow(hwnd32)) - { - /* callback didn't process this message */ - - switch(msg) - { - case WM_ERASEBKGND: - case WM_SHOWWINDOW: - case WM_ACTIVATE: - case WM_SETFOCUS: - case DM_SETDEFID: - case DM_GETDEFID: - case WM_NEXTDLGCTL: - case WM_GETFONT: - case WM_CLOSE: - case WM_NCDESTROY: - case WM_ENTERMENULOOP: - case WM_LBUTTONDOWN: - case WM_NCLBUTTONDOWN: - return DEFDLG_Proc( hwnd32, msg, (WPARAM)wParam, lParam, dlgInfo ); - case WM_INITDIALOG: - case WM_VKEYTOITEM: - case WM_COMPAREITEM: - case WM_CHARTOITEM: - break; - - default: - return DefWindowProc16( hwnd, msg, wParam, lParam ); - } - } - return DEFDLG_Epilog( hwnd32, msg, result); -} - - -/*********************************************************************** * DefDlgProcA (USER32.@) */ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) diff --git a/dlls/user32/msg16.c b/dlls/user32/msg16.c index dba7a14f12b..d5d4825daf9 100644 --- a/dlls/user32/msg16.c +++ b/dlls/user32/msg16.c @@ -77,6 +77,13 @@ static LRESULT get_message_callback( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARA return 0; } +static LRESULT defdlg_proc_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, + LRESULT *result, void *arg ) +{ + *result = DefDlgProcA( hwnd, msg, wp, lp ); + return *result; +} + /*********************************************************************** * SendMessage (USER.111) @@ -270,6 +277,17 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam, LPAR /*********************************************************************** + * DefDlgProc (USER.308) + */ +LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam ) +{ + LRESULT result; + WINPROC_CallProc16To32A( defdlg_proc_callback, hwnd, msg, wParam, lParam, &result, 0 ); + return result; +} + + +/*********************************************************************** * PeekMessage (USER.109) */ BOOL16 WINAPI PeekMessage16( MSG16 *msg, HWND16 hwnd, -- 2.11.4.GIT