hi
can i hide mouse pointer , when it comes over a window.
Printable View
hi
can i hide mouse pointer , when it comes over a window.
This thread should belong to WinAPI forum. Use ShowCursor() to change the visibility of the cursor. This is used in conjunction with SetCapture() and ReleaseCapture() in order to make a good mouse-over behaviour.
I recommend a similar code in your window procedure when hadling the WM_MOUSEMOVE message:
Choose your own place to declare the following used variables:Code:case WM_MOUSEMOVE:
GetCursorPos(&ptCurrentMousePosit);
if (!mCaptive)
{
SetCapture(hwnd);
ShowCursor(FALSE);
mCaptive = true;
}
else
{
if (WindowFromPoint(ptCurrentMousePosit) != hwnd)
{
ShowCursor(TRUE);
ReleaseCapture();
mCaptive = false;
}
}
break;
Bye,Code:static bool mCaptive;
static POINT ptCurrentMousePosit;
Thanx a lot