Alexandre Julliard : user32: Reimplement DefDlgProc16 using message mapping functions.
Alexandre Julliard
julliard at winehq.org
Fri Nov 13 09:37:02 CST 2009
Module: wine
Branch: master
Commit: 76dcb0ecb9c64a949314efa30ce32a29f3ba7b65
URL: http://source.winehq.org/git/wine.git/?a=commit;h=76dcb0ecb9c64a949314efa30ce32a29f3ba7b65
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Nov 13 11:11:31 2009 +0100
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 6096890..e57dae9 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 dba7a14..d5d4825 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,
More information about the wine-cvs
mailing list