Commit 314d2c3e authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add a Wow handler for the mdi client class.

parent 2c526b7f
......@@ -65,6 +65,7 @@ struct wow_handlers16
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
......@@ -77,6 +78,7 @@ struct wow_handlers32
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
WNDPROC (*alloc_winproc)(WNDPROC,WNDPROC);
......@@ -88,6 +90,7 @@ extern LRESULT ButtonWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDE
extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
......
......@@ -93,7 +93,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "wownt32.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "win.h"
#include "controls.h"
......@@ -1045,8 +1044,7 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR
/**********************************************************************
* MDIClientWndProc_common
*/
static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam, BOOL unicode )
LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
MDICLIENTINFO *ci;
......@@ -1070,26 +1068,11 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
{
/* Since we are using only cs->lpCreateParams, we can safely
* cast to LPCREATESTRUCTA here */
LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
WND *wndPtr = WIN_GetPtr( hwnd );
/* Translation layer doesn't know what's in the cs->lpCreateParams
* so we have to keep track of what environment we're in. */
if( wndPtr->flags & WIN_ISWIN32 )
{
LPCLIENTCREATESTRUCT ccs = cs->lpCreateParams;
ci->hWindowMenu = ccs->hWindowMenu;
ci->idFirstChild = ccs->idFirstChild;
}
else
{
LPCLIENTCREATESTRUCT16 ccs = MapSL(PtrToUlong(cs->lpCreateParams));
ci->hWindowMenu = HMENU_32(ccs->hWindowMenu);
ci->idFirstChild = ccs->idFirstChild;
}
WIN_ReleasePtr( wndPtr );
LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
LPCLIENTCREATESTRUCT ccs = cs->lpCreateParams;
ci->hWindowMenu = ccs->hWindowMenu;
ci->idFirstChild = ccs->idFirstChild;
ci->hwndChildMaximized = 0;
ci->child = NULL;
ci->nActiveChildren = 0;
......@@ -1294,7 +1277,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
if (!IsWindow(hwnd)) return 0;
return MDIClientWndProc_common( hwnd, message, wParam, lParam, FALSE );
return wow_handlers.mdiclient_proc( hwnd, message, wParam, lParam, FALSE );
}
/***********************************************************************
......@@ -1303,7 +1286,7 @@ static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam,
static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
if (!IsWindow(hwnd)) return 0;
return MDIClientWndProc_common( hwnd, message, wParam, lParam, TRUE );
return wow_handlers.mdiclient_proc( hwnd, message, wParam, lParam, TRUE );
}
/***********************************************************************
......
......@@ -2493,6 +2493,42 @@ static LRESULT listbox_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
/***********************************************************************
* mdiclient_proc16
*/
static LRESULT mdiclient_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
{
if (msg == WM_CREATE)
{
LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
WND *win;
BOOL is_win32;
if (!(win = WIN_GetPtr( hwnd ))) return 0;
is_win32 = (win == WND_OTHER_PROCESS || win == WND_DESKTOP || (win->flags & WIN_ISWIN32));
WIN_ReleasePtr( win );
/* Translation layer doesn't know what's in the cs->lpCreateParams
* so we have to keep track of what environment we're in. */
if (!is_win32)
{
void *orig = cs->lpCreateParams;
LRESULT ret;
CLIENTCREATESTRUCT ccs;
CLIENTCREATESTRUCT16 *ccs16 = MapSL( PtrToUlong( orig ));
ccs.hWindowMenu = HMENU_32(ccs16->hWindowMenu);
ccs.idFirstChild = ccs16->idFirstChild;
cs->lpCreateParams = &ccs;
ret = wow_handlers32.mdiclient_proc( hwnd, msg, wParam, lParam, unicode );
cs->lpCreateParams = orig;
return ret;
}
}
return wow_handlers32.mdiclient_proc( hwnd, msg, wParam, lParam, unicode );
}
/***********************************************************************
* scrollbar_proc16
*/
static LRESULT scrollbar_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode )
......@@ -2550,6 +2586,7 @@ void register_wow_handlers(void)
combo_proc16,
edit_proc16,
listbox_proc16,
mdiclient_proc16,
scrollbar_proc16,
static_proc16,
call_window_proc_Ato16,
......
......@@ -1044,6 +1044,7 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo
orig->combo_proc = ComboWndProc_common;
orig->edit_proc = EditWndProc_common;
orig->listbox_proc = ListBoxWndProc_common;
orig->mdiclient_proc = MDIClientWndProc_common;
orig->scrollbar_proc = ScrollBarWndProc_common;
orig->static_proc = StaticWndProc_common;
orig->alloc_winproc = WINPROC_AllocProc;
......@@ -1057,6 +1058,7 @@ struct wow_handlers16 wow_handlers =
ComboWndProc_common,
EditWndProc_common,
ListBoxWndProc_common,
MDIClientWndProc_common,
ScrollBarWndProc_common,
StaticWndProc_common,
NULL, /* call_window_proc */
......
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