comctl32: status: Send a NMMOUSE in mouse notifications, not a NMHDR.

This commit is contained in:
Mikołaj Zalewski 2007-05-13 21:03:27 +02:00 committed by Alexandre Julliard
parent b7ac570f39
commit 1f0183e218
1 changed files with 30 additions and 11 deletions

View File

@ -310,6 +310,20 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
} }
static int
STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const LPPOINT pt)
{
int i;
if (infoPtr->simple)
return 255;
for (i = 0; i < infoPtr->numParts; i++)
if (pt->x >= infoPtr->parts[i].bound.left && pt->x <= infoPtr->parts[i].bound.right)
return i;
return -2;
}
static void static void
STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr) STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
{ {
@ -1211,15 +1225,20 @@ STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
static LRESULT static LRESULT
STATUSBAR_SendNotify (const STATUS_INFO *infoPtr, UINT code) STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
{ {
NMHDR nmhdr; NMMOUSE nm;
TRACE("code %04x\n", code); TRACE("code %04x, lParam=%lx\n", code, lParam);
nmhdr.hwndFrom = infoPtr->Self; nm.hdr.hwndFrom = infoPtr->Self;
nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID); nm.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
nmhdr.code = code; nm.hdr.code = code;
SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr); nm.pt.x = (short)LOWORD(lParam);
nm.pt.y = (short)HIWORD(lParam);
nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
nm.dwItemData = 0;
nm.dwHitInfo = 0x30000; /* seems constant */
SendMessageW(infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nm);
return 0; return 0;
} }
@ -1320,10 +1339,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_GetTextLength (infoPtr, 0); return STATUSBAR_GetTextLength (infoPtr, 0);
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
return STATUSBAR_SendNotify (infoPtr, NM_DBLCLK); return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, lParam);
case WM_LBUTTONUP: case WM_LBUTTONUP:
return STATUSBAR_SendNotify (infoPtr, NM_CLICK); return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, lParam);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam); return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
@ -1347,10 +1366,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam); return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
return STATUSBAR_SendNotify (infoPtr, NM_RDBLCLK); return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, lParam);
case WM_RBUTTONUP: case WM_RBUTTONUP:
return STATUSBAR_SendNotify (infoPtr, NM_RCLICK); return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, lParam);
case WM_SETFONT: case WM_SETFONT:
return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam)); return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));