I am trying to hide the cursor in the client area of my window (DirectX application) but would like the default behavior in the title bar. I've tried several things but I didn't find any way to do this. Does anyone have an idea how to achieve this?
Add something like this to your wndproc:
case WM_SETCURSOR:
{
WORD ht = LOWORD(lparam);
static bool hiddencursor = false;
if (HTCLIENT==ht && !hiddencursor)
{
hiddencursor = true;
ShowCursor(false);
}
else if (HTCLIENT!=ht && hiddencursor)
{
hiddencursor = false;
ShowCursor(true);
}
}
break;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With