Call WH_GETMESSAGE hook in PeekMessage too (based on a patch by Rob

Farnum).
This commit is contained in:
Alexandre Julliard 2000-09-24 19:51:15 +00:00
parent 2a6acd3d70
commit 0ff083bab8
4 changed files with 35 additions and 19 deletions

View File

@ -111,7 +111,7 @@ owner user32
106 pascal16 GetKeyState(word) GetKeyState16
107 pascal DefWindowProc(word word word long) DefWindowProc16
108 pascal16 GetMessage(segptr word word word) GetMessage16
109 pascal16 PeekMessage(ptr word word word word) PeekMessage16
109 pascal16 PeekMessage(segptr word word word word) PeekMessage16
110 pascal16 PostMessage(word word word long) PostMessage16
111 pascal SendMessage(word word word long) SendMessage16
112 pascal16 WaitMessage() WaitMessage
@ -536,7 +536,7 @@ owner user32
802 stub OPENFILENAME_CALLBACK16
803 stub PRINTDLG_CALLBACK16
804 stub CHOOSECOLOR_CALLBACK16
819 pascal16 PeekMessage32(ptr word word word word word) PeekMessage32_16
819 pascal16 PeekMessage32(segptr word word word word word) PeekMessage32_16
820 pascal GetMessage32(segptr word word word word) GetMessage32_16
821 pascal16 TranslateMessage32(ptr word) TranslateMessage32_16
#821 stub IsDialogMessage32 # FIXME: two ordinal 821???

View File

@ -833,8 +833,8 @@ BOOL16 WINAPI MoveWindow16(HWND16,INT16,INT16,INT16,INT16,BOOL16);
void WINAPI OffsetRect16(LPRECT16,INT16,INT16);
BOOL16 WINAPI OpenClipboard16(HWND16);
BOOL16 WINAPI OpenIcon16(HWND16);
BOOL16 WINAPI PeekMessage16(LPMSG16,HWND16,UINT16,UINT16,UINT16);
BOOL16 WINAPI PeekMessage32_16(LPMSG16_32,HWND16,UINT16,UINT16,UINT16,BOOL16);
BOOL16 WINAPI PeekMessage16(SEGPTR,HWND16,UINT16,UINT16,UINT16);
BOOL16 WINAPI PeekMessage32_16(SEGPTR,HWND16,UINT16,UINT16,UINT16,BOOL16);
BOOL16 WINAPI PostAppMessage16(HTASK16,UINT16,WPARAM16,LPARAM);
BOOL16 WINAPI PostMessage16(HWND16,UINT16,WPARAM16,LPARAM);
void WINAPI PostQuitMessage16(INT16);

View File

@ -1374,11 +1374,12 @@ BOOL MSG_InternalGetMessage( int type, MSG *msg, HWND hwnd, HWND hwndOwner,
/***********************************************************************
* PeekMessage32_16 (USER.819)
*/
BOOL16 WINAPI PeekMessage32_16( LPMSG16_32 lpmsg16_32, HWND16 hwnd,
BOOL16 WINAPI PeekMessage32_16( SEGPTR msg16_32, HWND16 hwnd,
UINT16 first, UINT16 last, UINT16 flags,
BOOL16 wHaveParamHigh )
{
BOOL ret;
MSG32_16 *lpmsg16_32 = (MSG32_16 *)PTR_SEG_TO_LIN(msg16_32);
MSG msg;
ret = MSG_PeekMessage( QMSG_WIN16, &msg, hwnd, first, last, flags, TRUE );
@ -1394,16 +1395,17 @@ BOOL16 WINAPI PeekMessage32_16( LPMSG16_32 lpmsg16_32, HWND16 hwnd,
if ( wHaveParamHigh )
lpmsg16_32->wParamHigh = HIWORD(msg.wParam);
HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg16_32 );
return ret;
}
/***********************************************************************
* PeekMessage16 (USER.109)
*/
BOOL16 WINAPI PeekMessage16( LPMSG16 lpmsg, HWND16 hwnd,
BOOL16 WINAPI PeekMessage16( SEGPTR msg, HWND16 hwnd,
UINT16 first, UINT16 last, UINT16 flags )
{
return PeekMessage32_16( (LPMSG16_32)lpmsg, hwnd, first, last, flags, FALSE );
return PeekMessage32_16( msg, hwnd, first, last, flags, FALSE );
}
/***********************************************************************
@ -1412,7 +1414,14 @@ BOOL16 WINAPI PeekMessage16( LPMSG16 lpmsg, HWND16 hwnd,
BOOL WINAPI PeekMessageA( LPMSG lpmsg, HWND hwnd,
UINT min, UINT max, UINT wRemoveMsg)
{
return MSG_PeekMessage( QMSG_WIN32A, lpmsg, hwnd, min, max, wRemoveMsg, TRUE );
BOOL ret = MSG_PeekMessage( QMSG_WIN32A, lpmsg, hwnd, min, max, wRemoveMsg, TRUE );
TRACE( "peekmessage %04x, hwnd %04x, filter(%04x - %04x)\n",
lpmsg->message, hwnd, min, max );
if (ret) HOOK_CallHooksA( WH_GETMESSAGE, HC_ACTION,
wRemoveMsg & PM_REMOVE, (LPARAM)lpmsg );
return ret;
}
/***********************************************************************
@ -1450,7 +1459,10 @@ BOOL WINAPI PeekMessageW(
UINT wRemoveMsg /* removal flags */
)
{
return MSG_PeekMessage( QMSG_WIN32W, lpmsg, hwnd, min, max, wRemoveMsg, TRUE );
BOOL ret = MSG_PeekMessage( QMSG_WIN32W, lpmsg, hwnd, min, max, wRemoveMsg, TRUE );
if (ret) HOOK_CallHooksW( WH_GETMESSAGE, HC_ACTION,
wRemoveMsg & PM_REMOVE, (LPARAM)lpmsg );
return ret;
}
@ -1479,7 +1491,7 @@ BOOL16 WINAPI GetMessage32_16( SEGPTR msg16_32, HWND16 hWnd, UINT16 first,
TRACE( "message %04x, hwnd %04x, filter(%04x - %04x)\n",
lpmsg16_32->msg.message, hWnd, first, last );
HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg16_32 );
HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)msg16_32 );
return lpmsg16_32->msg.message != WM_QUIT;
}
@ -1501,7 +1513,7 @@ BOOL WINAPI GetMessageA( MSG *lpmsg, HWND hwnd, UINT min, UINT max )
TRACE( "message %04x, hwnd %04x, filter(%04x - %04x)\n",
lpmsg->message, hwnd, min, max );
HOOK_CallHooksA( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)lpmsg );
HOOK_CallHooksA( WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)lpmsg );
return lpmsg->message != WM_QUIT;
}
@ -1544,7 +1556,7 @@ BOOL WINAPI GetMessageW(
TRACE( "message %04x, hwnd %04x, filter(%04x - %04x)\n",
lpmsg->message, hwnd, min, max );
HOOK_CallHooksW( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)lpmsg );
HOOK_CallHooksW( WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)lpmsg );
return lpmsg->message != WM_QUIT;
}

View File

@ -3223,8 +3223,8 @@ BOOL16 WINAPI DragDetect16( HWND16 hWnd, POINT16 pt )
*/
BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
{
MSG16 msg;
RECT16 rect;
MSG msg;
RECT rect;
rect.left = pt.x - wDragWidth;
rect.right = pt.x + wDragWidth;
@ -3236,7 +3236,7 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
while(1)
{
while(PeekMessage16(&msg ,0 ,WM_MOUSEFIRST ,WM_MOUSELAST ,PM_REMOVE))
while(PeekMessageA(&msg ,0 ,WM_MOUSEFIRST ,WM_MOUSELAST ,PM_REMOVE))
{
if( msg.message == WM_LBUTTONUP )
{
@ -3245,7 +3245,10 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
}
if( msg.message == WM_MOUSEMOVE )
{
if( !PtInRect16( &rect, MAKEPOINT16(msg.lParam) ) )
POINT tmp;
tmp.x = LOWORD(msg.lParam);
tmp.y = HIWORD(msg.lParam);
if( !PtInRect( &rect, tmp ))
{
ReleaseCapture();
return 1;
@ -3263,7 +3266,7 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
HANDLE16 hOfStruct, WORD szList, HCURSOR16 hCursor )
{
MSG16 msg;
MSG msg;
LPDRAGINFO lpDragInfo;
SEGPTR spDragInfo;
HCURSOR16 hDragCursor=0, hOldCursor=0, hBummer=0;
@ -3318,11 +3321,12 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
do
{
do{ WaitMessage(); }
while( !PeekMessage16(&msg,0,WM_MOUSEFIRST,WM_MOUSELAST,PM_REMOVE) );
while( !PeekMessageA(&msg,0,WM_MOUSEFIRST,WM_MOUSELAST,PM_REMOVE) );
*(lpDragInfo+1) = *lpDragInfo;
lpDragInfo->pt = msg.pt;
lpDragInfo->pt.x = msg.pt.x;
lpDragInfo->pt.y = msg.pt.y;
/* update DRAGINFO struct */
TRACE_(msg)("lpDI->hScope = %04x\n",lpDragInfo->hScope);