开发者

Hide Cursor in Client Rectangle but not on Title Bar

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜