Advertisement

Stupid Mouse Cursor

Started by June 24, 2001 12:50 AM
3 comments, last by Antoxa 23 years, 7 months ago
In my game I have to hide current mouse cursor to draw my own one. And I do like this: void Video_Init (void) { HWND mainwindow; // main window handle ... // switch video mode if it''s necessary if (switchmode) ChangeResolution (); mainwindow = CreateMainWindow (); SetForegroundWindow (mainwindow); SetCapture (mainwindow); ShowCursor (false); ... } But after the game switches the video mode the mouse cursor do not disapear and remains visible until the next mouse button click. And after the click the main window loses its focus and becomes inactive until the next mouse button click. What does all this mean? And how can I hide the stupid cursor even after the video mode switching?
I love games!
It sounds like your window may be too small. Are you sure you''re setting it to the same dimensions as your resolution? Also, what window styles are you using?
Advertisement
The window client area is 640 x 480 and I try to set this resolution.

The main window is WS_POPUP.
I love games!
In your WindowProc you have to get the WM_SETCURSOR message and set the cursor to null.

case WM_SETCURSOR:
SetCursor(NULL);
return TRUE;


Digital Radiation
Have you tried removing the system cursor before switching video modes? If the system cursor is going to be removed in all cases, then remove it before taking any other action that does not require its presence. (I''ve never had to touch WM_SETCURSOR messages either.)



MatrixCubed
http://MatrixCubed.org






This topic is closed to new replies.

Advertisement