HCURSOR myCursor;
MyCursor=(HCURSOR) LoadImage (NULL, _T (" res/cursor1. Cur "), IMAGE_CURSOR, 9, 9, LR_LOADFROMFILE);
SetClassLong (this - & gt; GCL_HCURSOR GetSafeHwnd (), (LONG) myCursor);
Also the code, I can in the Demo, but in the product process is invalid,
But the product program
SetClassLong (this - & gt; GCL_HCURSOR GetSafeHwnd (), (LONG) LoadCursor (NULL, IDC_CROSS));
Is a valid
SetClassLong ( this - & gt; GCL_HCURSOR GetSafeHwnd () , (LONG) myCursor);
This place has a problem?
CodePudding user response:
MyCursor scope for? (can't be a local variable)MyCursor mouse is loaded successfully (handle) effectively?
CodePudding user response:
Using SetCursor (LoadCursor (NULL, IDC_WAIT));