Reputation: 443
I'm trying to change the cursor permanently to some other cursor.
When I do this all I get is the new cursor until I move the cursor again.
case WM_RBUTTONDOWN:
cursor = LoadCursor (NULL, IDC_CROSS) ;
SetCursor(cursor);
break;
How do I change it so that it will be permanent.. I know it has something to do with wndclass..
When I make the window in wndproc I said wndclass.hIcon to IDC_ARROW but I can't call wndclass in WM_RBUTTONDOWN..
Any help?
Upvotes: 4
Views: 2447
Reputation: 308158
Each mouse movement causes a WM_SETCURSOR
message to be sent to your window; the default window procedure will respond with the configured cursor. Override to return your new cursor instead.
Upvotes: 4
Reputation: 63775
From the documentation for SetCursor
:
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
You need to remove any specified cursor from your window class.
Upvotes: 3