Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change cursor permanently

Tags:

c++

winapi

api

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?

like image 527
Jesse Moreland Avatar asked Mar 25 '23 05:03

Jesse Moreland


1 Answers

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.

like image 176
Mark Ransom Avatar answered Apr 02 '23 12:04

Mark Ransom