TCHAR szButtonCoordinates[50];
RECT rect;
switch (message)
{
...
case WM_MOUSEMOVE:
hWndButton = GetDlgItem (hWnd, IDC_BUTTON);
GetClientRect (hWndButton, &rect);
MapWindowPoints (hWndButton, hWnd, (LPPOINT) &rect, 2);
// wsprintf (szButtonCoordinates, _T("Top: %d, Left: %d, Bottom: %d, Right: %d."),rect.top, rect.left, rect.bottom, rect.right);
if (((LOWORD (lParam) >= rect.left) && (LOWORD (lParam) <= rect.right)) && ((HIWORD (lParam) >=rect.top) && (HIWORD (lParam) <= rect.bottom)))
{
//MessageBox (hWndProg3, szButtonCoordinates, _T("Button Coordinates"), MB_ICONINFORMATION);
SetCursor (LoadCursor (NULL, IDC_CROSS));
}
break;
...
}