简体   繁体   中英

c++ set a cursor using SetCursor

ok im setting a cursor in a loop it works but when i move the cursor it just changes back to the way it was. im using win32 api and i used
SetCursor(LoadCursor(hInstance, MAKEINTRESOURCE(IDC_PROTECTED)));
any idea

IIRC, you want to call SetCursor in response to WM_SETCURSOR . If memory serves, the cursor will also stay what you've set if the cursor member of the window class is set to NULL.

Yes. It is being changed by DefWindowProc().

if you want a different cursor over your window, use SetClassLong(), or, change the hCursor field of WNDCLASS when calling RegisterClass, if you are the one who's calling it youself

也许您可以尝试在WM_MOUSEMOVE中使用setcursor。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM