When processing mouse messages in MENU_TrackMenu, use the coordinates

in lParam instead of those in MSG::pt.
This commit is contained in:
Louis Philippe Gagnon 2000-11-27 22:39:35 +00:00 committed by Alexandre Julliard
parent 256ac22dee
commit 9cdd22c53d
1 changed files with 11 additions and 1 deletions

View File

@ -2782,8 +2782,18 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fRemove = FALSE;
if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
{
/*
* use the mouse coordinates in lParam instead of those in the MSG
* struct to properly handle synthetic messages. lParam coords are
* relative to client area, so they must be converted; since they can
* be negative, we must use SLOWORD/SHIWORD instead of LOWORD/HIWORD.
*/
mt.pt.x = SLOWORD(msg.lParam);
mt.pt.y = SHIWORD(msg.lParam);
ClientToScreen(msg.hwnd,&mt.pt);
/* Find a menu for this mouse event */
hmenu = MENU_PtMenu( mt.hTopMenu, msg.pt );
hmenu = MENU_PtMenu( mt.hTopMenu, mt.pt );
switch(msg.message)
{