Question : Hiding the mouse cursor

I did a search on this, but don't think I found what I was looking for.

Using VC++ 6.0, what is the mose appropriate way to hide the mouse cursor? I found one thread that would move the pointer off screen to the lower right, but wouldn't that keep the actual mouse location there? Note, I do not want to disable the mouse, or otherwise affect the  WM_MOUSEMOVE and associated message paramaters that represent the mouse location, the user will still be using the mouse, but I am capturing the movement, and rather than showing a cursor, drawing a graphical cross-hair overlay on the screen (not a cursor per say) that follows it, so I need to simply make the system mouse cursor invisible, but affect it in no other way. The overlay stuff is all working, so I just need to make the system cursor invisible (and of course be able to turn it back on as well :)

Thanks!
-Paul

Answer : Hiding the mouse cursor

Create empty cursor in the project resources. This cursor should contain only transparent background. Load this cursor using LoadCursor function:
HCURSOR hInvisibleCursor = AfxGetApp()->LoadCursor(IDC_CURSOR_INVISIBLE);

Overwrite OnSetCursor function. Of you want to make cursor invisible, call SetCursor(hInvisibleCursor) and return TRUE. If you want to show standard cursor, call base class function:
return CWnd::OnSetCursor(pWnd, nHitTest, message);
Random Solutions  
 
programming4us programming4us