2001-08-07 21:19:08 +02:00
|
|
|
/*
|
|
|
|
* 16-bit messaging support
|
|
|
|
*
|
|
|
|
* Copyright 2001 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-08-07 21:19:08 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wine/winuser16.h"
|
2002-10-17 18:43:42 +02:00
|
|
|
#include "wownt32.h"
|
2001-10-15 19:56:45 +02:00
|
|
|
#include "winerror.h"
|
2001-08-07 21:19:08 +02:00
|
|
|
#include "win.h"
|
2004-12-08 19:06:14 +01:00
|
|
|
#include "user_private.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msg);
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2001-12-26 20:46:40 +01:00
|
|
|
DWORD USER16_AlertableWait = 0;
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2006-05-20 16:32:45 +02:00
|
|
|
static LRESULT cwp_hook_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
CWPSTRUCT cwp;
|
|
|
|
|
|
|
|
cwp.hwnd = hwnd;
|
|
|
|
cwp.message = msg;
|
|
|
|
cwp.wParam = wp;
|
|
|
|
cwp.lParam = lp;
|
|
|
|
*result = 0;
|
|
|
|
return HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp, FALSE );
|
|
|
|
}
|
|
|
|
|
|
|
|
static LRESULT send_message_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
*result = SendMessageA( hwnd, msg, wp, lp );
|
|
|
|
return *result;
|
|
|
|
}
|
|
|
|
|
2006-05-23 20:15:17 +02:00
|
|
|
static LRESULT post_message_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
*result = 0;
|
|
|
|
return PostMessageA( hwnd, msg, wp, lp );
|
|
|
|
}
|
|
|
|
|
|
|
|
static LRESULT post_thread_message_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
DWORD_PTR tid = (DWORD_PTR)arg;
|
|
|
|
*result = 0;
|
|
|
|
return PostThreadMessageA( tid, msg, wp, lp );
|
|
|
|
}
|
|
|
|
|
|
|
|
static LRESULT get_message_callback( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARAM lp,
|
|
|
|
LRESULT *result, void *arg )
|
|
|
|
{
|
|
|
|
MSG16 *msg16 = arg;
|
|
|
|
|
|
|
|
msg16->hwnd = hwnd;
|
|
|
|
msg16->message = msg;
|
|
|
|
msg16->wParam = wp;
|
|
|
|
msg16->lParam = lp;
|
|
|
|
*result = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-11-13 11:11:31 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2006-05-20 16:32:45 +02:00
|
|
|
|
2001-08-07 21:19:08 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* SendMessage (USER.111)
|
|
|
|
*/
|
2001-09-19 22:37:04 +02:00
|
|
|
LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
|
2001-08-07 21:19:08 +02:00
|
|
|
{
|
|
|
|
LRESULT result;
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwnd = WIN_Handle32( hwnd16 );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2001-09-24 03:19:59 +02:00
|
|
|
if (hwnd != HWND_BROADCAST && WIN_IsCurrentThread(hwnd))
|
2001-08-07 21:19:08 +02:00
|
|
|
{
|
|
|
|
/* call 16-bit window proc directly */
|
|
|
|
WNDPROC16 winproc;
|
|
|
|
|
|
|
|
/* first the WH_CALLWNDPROC hook */
|
|
|
|
if (HOOK_IsHooked( WH_CALLWNDPROC ))
|
2006-05-20 16:32:45 +02:00
|
|
|
WINPROC_CallProc16To32A( cwp_hook_callback, hwnd16, msg, wparam, lparam, &result, NULL );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2004-09-22 21:14:08 +02:00
|
|
|
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWLP_WNDPROC ))) return 0;
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
SPY_EnterMessage( SPY_SENDMESSAGE16, hwnd, msg, wparam, lparam );
|
2006-05-09 15:03:14 +02:00
|
|
|
result = CallWindowProc16( winproc, hwnd16, msg, wparam, lparam );
|
2001-08-07 21:19:08 +02:00
|
|
|
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg, result, wparam, lparam );
|
|
|
|
}
|
|
|
|
else /* map to 32-bit unicode for inter-thread/process message */
|
|
|
|
{
|
2006-05-20 16:32:45 +02:00
|
|
|
WINPROC_CallProc16To32A( send_message_callback, hwnd16, msg, wparam, lparam, &result, NULL );
|
2001-08-07 21:19:08 +02:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PostMessage (USER.110)
|
|
|
|
*/
|
2006-05-23 20:15:17 +02:00
|
|
|
BOOL16 WINAPI PostMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
|
2001-08-07 21:19:08 +02:00
|
|
|
{
|
2006-05-23 20:15:17 +02:00
|
|
|
LRESULT unused;
|
|
|
|
return WINPROC_CallProc16To32A( post_message_callback, hwnd, msg, wparam, lparam, &unused, NULL );
|
2001-08-07 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PostAppMessage (USER.116)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI PostAppMessage16( HTASK16 hTask, UINT16 msg, WPARAM16 wparam, LPARAM lparam )
|
|
|
|
{
|
2006-05-23 20:15:17 +02:00
|
|
|
LRESULT unused;
|
|
|
|
DWORD_PTR tid = HTASK_32( hTask );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2006-05-23 20:15:17 +02:00
|
|
|
if (!tid) return FALSE;
|
|
|
|
return WINPROC_CallProc16To32A( post_thread_message_callback, 0, msg, wparam, lparam,
|
|
|
|
&unused, (void *)tid );
|
2001-08-07 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* InSendMessage (USER.192)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI InSendMessage16(void)
|
|
|
|
{
|
|
|
|
return InSendMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ReplyMessage (USER.115)
|
|
|
|
*/
|
|
|
|
void WINAPI ReplyMessage16( LRESULT result )
|
|
|
|
{
|
|
|
|
ReplyMessage( result );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PeekMessage32 (USER.819)
|
|
|
|
*/
|
2001-09-19 22:37:04 +02:00
|
|
|
BOOL16 WINAPI PeekMessage32_16( MSG32_16 *msg16, HWND16 hwnd16,
|
2001-08-07 21:19:08 +02:00
|
|
|
UINT16 first, UINT16 last, UINT16 flags,
|
|
|
|
BOOL16 wHaveParamHigh )
|
|
|
|
{
|
|
|
|
MSG msg;
|
2006-05-23 20:15:17 +02:00
|
|
|
LRESULT unused;
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwnd = WIN_Handle32( hwnd16 );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2001-12-26 20:46:40 +01:00
|
|
|
if(USER16_AlertableWait)
|
2007-05-18 00:01:05 +02:00
|
|
|
MsgWaitForMultipleObjectsEx( 0, NULL, 0, 0, MWMO_ALERTABLE );
|
2006-05-20 16:35:44 +02:00
|
|
|
if (!PeekMessageA( &msg, hwnd, first, last, flags )) return FALSE;
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
msg16->msg.time = msg.time;
|
|
|
|
msg16->msg.pt.x = (INT16)msg.pt.x;
|
|
|
|
msg16->msg.pt.y = (INT16)msg.pt.y;
|
|
|
|
if (wHaveParamHigh) msg16->wParamHigh = HIWORD(msg.wParam);
|
2006-05-23 20:15:17 +02:00
|
|
|
WINPROC_CallProc32ATo16( get_message_callback, msg.hwnd, msg.message, msg.wParam, msg.lParam,
|
|
|
|
&unused, &msg16->msg );
|
|
|
|
return TRUE;
|
2001-08-07 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-18 12:45:17 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DefWindowProc (USER.107)
|
|
|
|
*/
|
|
|
|
LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
LRESULT result;
|
|
|
|
HWND hwnd = WIN_Handle32( hwnd16 );
|
|
|
|
|
|
|
|
SPY_EnterMessage( SPY_DEFWNDPROC16, hwnd, msg, wParam, lParam );
|
|
|
|
|
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_NCCREATE:
|
|
|
|
{
|
|
|
|
CREATESTRUCT16 *cs16 = MapSL(lParam);
|
|
|
|
CREATESTRUCTA cs32;
|
|
|
|
|
2007-05-30 12:32:24 +02:00
|
|
|
cs32.lpCreateParams = ULongToPtr(cs16->lpCreateParams);
|
2005-01-18 12:45:17 +01:00
|
|
|
cs32.hInstance = HINSTANCE_32(cs16->hInstance);
|
|
|
|
cs32.hMenu = HMENU_32(cs16->hMenu);
|
|
|
|
cs32.hwndParent = WIN_Handle32(cs16->hwndParent);
|
|
|
|
cs32.cy = cs16->cy;
|
|
|
|
cs32.cx = cs16->cx;
|
|
|
|
cs32.y = cs16->y;
|
|
|
|
cs32.x = cs16->x;
|
|
|
|
cs32.style = cs16->style;
|
|
|
|
cs32.dwExStyle = cs16->dwExStyle;
|
|
|
|
cs32.lpszName = MapSL(cs16->lpszName);
|
|
|
|
cs32.lpszClass = MapSL(cs16->lpszClass);
|
|
|
|
result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)&cs32 );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_NCCALCSIZE:
|
|
|
|
{
|
|
|
|
RECT16 *rect16 = MapSL(lParam);
|
|
|
|
RECT rect32;
|
|
|
|
|
|
|
|
rect32.left = rect16->left;
|
|
|
|
rect32.top = rect16->top;
|
|
|
|
rect32.right = rect16->right;
|
|
|
|
rect32.bottom = rect16->bottom;
|
|
|
|
|
|
|
|
result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)&rect32 );
|
|
|
|
|
|
|
|
rect16->left = rect32.left;
|
|
|
|
rect16->top = rect32.top;
|
|
|
|
rect16->right = rect32.right;
|
|
|
|
rect16->bottom = rect32.bottom;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS16 *pos16 = MapSL(lParam);
|
|
|
|
WINDOWPOS pos32;
|
|
|
|
|
|
|
|
pos32.hwnd = WIN_Handle32(pos16->hwnd);
|
|
|
|
pos32.hwndInsertAfter = WIN_Handle32(pos16->hwndInsertAfter);
|
|
|
|
pos32.x = pos16->x;
|
|
|
|
pos32.y = pos16->y;
|
|
|
|
pos32.cx = pos16->cx;
|
|
|
|
pos32.cy = pos16->cy;
|
|
|
|
pos32.flags = pos16->flags;
|
|
|
|
|
|
|
|
result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)&pos32 );
|
|
|
|
|
|
|
|
pos16->hwnd = HWND_16(pos32.hwnd);
|
|
|
|
pos16->hwndInsertAfter = HWND_16(pos32.hwndInsertAfter);
|
|
|
|
pos16->x = pos32.x;
|
|
|
|
pos16->y = pos32.y;
|
|
|
|
pos16->cx = pos32.cx;
|
|
|
|
pos16->cy = pos32.cy;
|
|
|
|
pos16->flags = pos32.flags;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_GETTEXT:
|
|
|
|
case WM_SETTEXT:
|
|
|
|
result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)MapSL(lParam) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
result = DefWindowProcA( hwnd, msg, wParam, lParam );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SPY_ExitMessage( SPY_RESULT_DEFWND16, hwnd, msg, result, wParam, lParam );
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-13 11:11:31 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-07 21:19:08 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* PeekMessage (USER.109)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI PeekMessage16( MSG16 *msg, HWND16 hwnd,
|
|
|
|
UINT16 first, UINT16 last, UINT16 flags )
|
|
|
|
{
|
|
|
|
return PeekMessage32_16( (MSG32_16 *)msg, hwnd, first, last, flags, FALSE );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessage32 (USER.820)
|
|
|
|
*/
|
2001-09-19 22:37:04 +02:00
|
|
|
BOOL16 WINAPI GetMessage32_16( MSG32_16 *msg16, HWND16 hwnd16, UINT16 first,
|
2001-08-07 21:19:08 +02:00
|
|
|
UINT16 last, BOOL16 wHaveParamHigh )
|
|
|
|
{
|
|
|
|
MSG msg;
|
2006-05-23 20:15:17 +02:00
|
|
|
LRESULT unused;
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwnd = WIN_Handle32( hwnd16 );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2006-05-23 20:15:17 +02:00
|
|
|
if(USER16_AlertableWait)
|
|
|
|
MsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, 0, MWMO_ALERTABLE );
|
|
|
|
GetMessageA( &msg, hwnd, first, last );
|
|
|
|
msg16->msg.time = msg.time;
|
|
|
|
msg16->msg.pt.x = (INT16)msg.pt.x;
|
|
|
|
msg16->msg.pt.y = (INT16)msg.pt.y;
|
|
|
|
if (wHaveParamHigh) msg16->wParamHigh = HIWORD(msg.wParam);
|
|
|
|
WINPROC_CallProc32ATo16( get_message_callback, msg.hwnd, msg.message, msg.wParam, msg.lParam,
|
|
|
|
&unused, &msg16->msg );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2002-11-22 22:22:14 +01:00
|
|
|
TRACE( "message %04x, hwnd %p, filter(%04x - %04x)\n",
|
2001-08-07 21:19:08 +02:00
|
|
|
msg16->msg.message, hwnd, first, last );
|
|
|
|
|
|
|
|
return msg16->msg.message != WM_QUIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMessage (USER.108)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI GetMessage16( MSG16 *msg, HWND16 hwnd, UINT16 first, UINT16 last )
|
|
|
|
{
|
|
|
|
return GetMessage32_16( (MSG32_16 *)msg, hwnd, first, last, FALSE );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TranslateMessage32 (USER.821)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI TranslateMessage32_16( const MSG32_16 *msg, BOOL16 wHaveParamHigh )
|
|
|
|
{
|
|
|
|
MSG msg32;
|
|
|
|
|
2001-09-19 22:37:04 +02:00
|
|
|
msg32.hwnd = WIN_Handle32( msg->msg.hwnd );
|
2001-08-07 21:19:08 +02:00
|
|
|
msg32.message = msg->msg.message;
|
|
|
|
msg32.wParam = MAKEWPARAM( msg->msg.wParam, wHaveParamHigh ? msg->wParamHigh : 0 );
|
|
|
|
msg32.lParam = msg->msg.lParam;
|
|
|
|
return TranslateMessage( &msg32 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TranslateMessage (USER.113)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI TranslateMessage16( const MSG16 *msg )
|
|
|
|
{
|
2004-11-30 22:38:57 +01:00
|
|
|
return TranslateMessage32_16( (const MSG32_16 *)msg, FALSE );
|
2001-08-07 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DispatchMessage (USER.114)
|
|
|
|
*/
|
|
|
|
LONG WINAPI DispatchMessage16( const MSG16* msg )
|
|
|
|
{
|
|
|
|
WND * wndPtr;
|
|
|
|
WNDPROC16 winproc;
|
|
|
|
LONG retval;
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwnd = WIN_Handle32( msg->hwnd );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
/* Process timer messages */
|
|
|
|
if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
|
|
|
|
{
|
|
|
|
if (msg->lParam)
|
|
|
|
return CallWindowProc16( (WNDPROC16)msg->lParam, msg->hwnd,
|
|
|
|
msg->message, msg->wParam, GetTickCount() );
|
|
|
|
}
|
|
|
|
|
2002-10-28 20:04:39 +01:00
|
|
|
if (!(wndPtr = WIN_GetPtr( hwnd )))
|
2001-08-07 21:19:08 +02:00
|
|
|
{
|
2001-10-15 19:56:45 +02:00
|
|
|
if (msg->hwnd) SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
|
|
|
return 0;
|
|
|
|
}
|
2005-03-24 16:18:50 +01:00
|
|
|
if (wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP)
|
2001-10-15 19:56:45 +02:00
|
|
|
{
|
2005-03-24 16:18:50 +01:00
|
|
|
if (IsWindow( hwnd )) SetLastError( ERROR_MESSAGE_SYNC_ONLY );
|
|
|
|
else SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
2001-10-15 19:56:45 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2006-05-10 16:55:55 +02:00
|
|
|
winproc = WINPROC_GetProc16( wndPtr->winproc, wndPtr->flags & WIN_ISUNICODE );
|
2001-10-15 19:56:45 +02:00
|
|
|
WIN_ReleasePtr( wndPtr );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
2001-09-19 22:37:04 +02:00
|
|
|
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, hwnd, msg->message, msg->wParam, msg->lParam );
|
2001-08-07 21:19:08 +02:00
|
|
|
retval = CallWindowProc16( winproc, msg->hwnd, msg->message, msg->wParam, msg->lParam );
|
2001-09-19 22:37:04 +02:00
|
|
|
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg->message, retval, msg->wParam, msg->lParam );
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DispatchMessage32 (USER.822)
|
|
|
|
*/
|
|
|
|
LONG WINAPI DispatchMessage32_16( const MSG32_16 *msg16, BOOL16 wHaveParamHigh )
|
|
|
|
{
|
|
|
|
if (wHaveParamHigh == FALSE)
|
|
|
|
return DispatchMessage16( &msg16->msg );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
|
2001-09-19 22:37:04 +02:00
|
|
|
msg.hwnd = WIN_Handle32( msg16->msg.hwnd );
|
2001-08-07 21:19:08 +02:00
|
|
|
msg.message = msg16->msg.message;
|
|
|
|
msg.wParam = MAKEWPARAM( msg16->msg.wParam, msg16->wParamHigh );
|
|
|
|
msg.lParam = msg16->msg.lParam;
|
|
|
|
msg.time = msg16->msg.time;
|
|
|
|
msg.pt.x = msg16->msg.pt.x;
|
|
|
|
msg.pt.y = msg16->msg.pt.y;
|
|
|
|
return DispatchMessageA( &msg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-05 02:23:02 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* IsDialogMessage (USER.90)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, MSG16 *msg16 )
|
|
|
|
{
|
|
|
|
MSG msg;
|
2003-12-31 01:15:16 +01:00
|
|
|
HWND hwndDlg32;
|
|
|
|
|
|
|
|
msg.hwnd = WIN_Handle32(msg16->hwnd);
|
|
|
|
hwndDlg32 = WIN_Handle32(hwndDlg);
|
2002-07-05 02:23:02 +02:00
|
|
|
|
|
|
|
switch(msg16->message)
|
|
|
|
{
|
|
|
|
case WM_KEYDOWN:
|
|
|
|
case WM_CHAR:
|
|
|
|
case WM_SYSCHAR:
|
2006-05-20 16:35:44 +02:00
|
|
|
msg.message = msg16->message;
|
|
|
|
msg.wParam = msg16->wParam;
|
|
|
|
msg.lParam = msg16->lParam;
|
|
|
|
return IsDialogMessageA( hwndDlg32, &msg );
|
2002-07-05 02:23:02 +02:00
|
|
|
}
|
2003-12-31 01:15:16 +01:00
|
|
|
|
|
|
|
if ((hwndDlg32 != msg.hwnd) && !IsChild( hwndDlg32, msg.hwnd )) return FALSE;
|
2002-07-05 02:23:02 +02:00
|
|
|
TranslateMessage16( msg16 );
|
|
|
|
DispatchMessage16( msg16 );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-07 21:19:08 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* MsgWaitForMultipleObjects (USER.640)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI MsgWaitForMultipleObjects16( DWORD count, CONST HANDLE *handles,
|
|
|
|
BOOL wait_all, DWORD timeout, DWORD mask )
|
|
|
|
{
|
|
|
|
return MsgWaitForMultipleObjectsEx( count, handles, timeout, mask,
|
|
|
|
wait_all ? MWMO_WAITALL : 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* SetDoubleClickTime (USER.20)
|
|
|
|
*/
|
|
|
|
void WINAPI SetDoubleClickTime16( UINT16 interval )
|
|
|
|
{
|
|
|
|
SetDoubleClickTime( interval );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* GetDoubleClickTime (USER.21)
|
|
|
|
*/
|
|
|
|
UINT16 WINAPI GetDoubleClickTime16(void)
|
|
|
|
{
|
|
|
|
return GetDoubleClickTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PostQuitMessage (USER.6)
|
|
|
|
*/
|
|
|
|
void WINAPI PostQuitMessage16( INT16 exitCode )
|
|
|
|
{
|
|
|
|
PostQuitMessage( exitCode );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-08 20:56:31 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* GetKeyState (USER.106)
|
|
|
|
*/
|
|
|
|
INT16 WINAPI GetKeyState16(INT16 vkey)
|
|
|
|
{
|
|
|
|
return GetKeyState(vkey);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* GetKeyboardState (USER.222)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetKeyboardState16( LPBYTE state )
|
|
|
|
{
|
|
|
|
return GetKeyboardState( state );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* SetKeyboardState (USER.223)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetKeyboardState16( LPBYTE state )
|
|
|
|
{
|
|
|
|
return SetKeyboardState( state );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-07 21:19:08 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* SetMessageQueue (USER.266)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI SetMessageQueue16( INT16 size )
|
|
|
|
{
|
|
|
|
return SetMessageQueue( size );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-12 22:01:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* UserYield (USER.332)
|
|
|
|
*/
|
|
|
|
void WINAPI UserYield16(void)
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
PeekMessageW( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-07 21:19:08 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetQueueStatus (USER.334)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI GetQueueStatus16( UINT16 flags )
|
|
|
|
{
|
|
|
|
return GetQueueStatus( flags );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetInputState (USER.335)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI GetInputState16(void)
|
|
|
|
{
|
|
|
|
return GetInputState();
|
|
|
|
}
|
2001-09-19 22:37:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* TranslateAccelerator (USER.178)
|
|
|
|
*/
|
|
|
|
INT16 WINAPI TranslateAccelerator16( HWND16 hwnd, HACCEL16 hAccel, LPMSG16 msg )
|
|
|
|
{
|
|
|
|
MSG msg32;
|
|
|
|
|
|
|
|
if (!msg) return 0;
|
|
|
|
msg32.message = msg->message;
|
|
|
|
/* msg32.hwnd not used */
|
|
|
|
msg32.wParam = msg->wParam;
|
|
|
|
msg32.lParam = msg->lParam;
|
2003-11-26 05:09:00 +01:00
|
|
|
return TranslateAcceleratorW( WIN_Handle32(hwnd), HACCEL_32(hAccel), &msg32 );
|
2001-09-19 22:37:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* TranslateMDISysAccel (USER.451)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
|
|
|
|
{
|
|
|
|
if (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
|
|
|
|
{
|
|
|
|
MSG msg32;
|
|
|
|
msg32.hwnd = WIN_Handle32(msg->hwnd);
|
|
|
|
msg32.message = msg->message;
|
|
|
|
msg32.wParam = msg->wParam;
|
|
|
|
msg32.lParam = msg->lParam;
|
|
|
|
/* MDICLIENTINFO is still the same for win32 and win16 ... */
|
|
|
|
return TranslateMDISysAccel( WIN_Handle32(hwndClient), &msg32 );
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|