changing the cursor
-
Hi! I'm trying to set the mouse to a custom cursor while it's in the client window. I made a cursor with myhcur = CreateCursor(...) I tried SetCursor(myhcur), but it got immediately changed back to the normal arrow cursor. So then I tried changing the system cursor from arrow to my custom cursor, which I did with SetSystemCursor(myhcur, 32512). I used 32512 instead of OCR_NORMAL because the compiler thought it was an undefined symbol even when I'd included winuser.h. So now I have my own custom cursor instead of the arrow and everything works great. The problem is that I can't switch back. I've tried each of hnormal = (HCURSOR) LoadImage(0, (char *) 32512/*OCR_NORMAL*/, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE); and hnormal = LoadCursor(0, IDC_ARROW); But when I try to set these back when my program ends, SetSystemCursor(hnormal, 32512) returns no error but doesn't change the cursor back. :)...:confused:...:((...:mad:
-
Hi! I'm trying to set the mouse to a custom cursor while it's in the client window. I made a cursor with myhcur = CreateCursor(...) I tried SetCursor(myhcur), but it got immediately changed back to the normal arrow cursor. So then I tried changing the system cursor from arrow to my custom cursor, which I did with SetSystemCursor(myhcur, 32512). I used 32512 instead of OCR_NORMAL because the compiler thought it was an undefined symbol even when I'd included winuser.h. So now I have my own custom cursor instead of the arrow and everything works great. The problem is that I can't switch back. I've tried each of hnormal = (HCURSOR) LoadImage(0, (char *) 32512/*OCR_NORMAL*/, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE); and hnormal = LoadCursor(0, IDC_ARROW); But when I try to set these back when my program ends, SetSystemCursor(hnormal, 32512) returns no error but doesn't change the cursor back. :)...:confused:...:((...:mad:
Handle WM_SETCURSOR and call SetCursor() in response to that message. --Mike-- http://home.inreach.com/mdunn/ "Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall." -- Lt. Cmdr. Worf
-
Handle WM_SETCURSOR and call SetCursor() in response to that message. --Mike-- http://home.inreach.com/mdunn/ "Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall." -- Lt. Cmdr. Worf
Thanks, I just finally found that. I guess DefWindowProc was the culprit that kept changing the cursor back!