Stupid Mouse Cursor
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?
The window client area is 640 x 480 and I try to set this resolution.
The main window is WS_POPUP.
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
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
![](http://24.114.12.207/paleribbon.jpg)
MatrixCubed
http://MatrixCubed.org
![](http://24.114.12.207/paleribbon.jpg)
[ Odyssey Project ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement