WM_SIZE doesn't work as intended
Hello! I hope that you can halp me with my particular problem.
I need to hide the mousecurser when the window is getting maximized and to display it again when the window gets restored.
Now i do the following:
Code:
if (wParam == SIZE_MAXIMIZED) //check whether the user has maximized the window
{
memset(&devModeScreen, 0, sizeof(devModeScreen));
devModeScreen.dmSize = sizeof(devModeScreen);
devModeScreen.dmPelsWidth = screenWidth;
devModeScreen.dmPelsHeight = screenHeight;
devModeScreen.dmBitsPerPel = screenBpp;
devModeScreen.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
dwExStyle = WS_EX_APPWINDOW; //hide all topper level windows
dwStyle = WS_POPUP; //remove the window borders
ShowCursor(FALSE); //hide the cursor
fullScreen = true;
}
else
{
dwExStyle=NULL;
dwStyle = WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
ShowCursor(TRUE); //show the cursor
fullScreen = false;
}
But this code doesn't hide the cursor at all! It first hides it and then shows it up again even though i put it into the else chunk.
I've already tried to use SIZE_RESTORED instead of the else and this has the same effect. Hence i think it's always calling for the SIZE_RESTORED. But why is it doing that? I'm not restoring it at all!
(I can't imagine this is not due to a wrong if/else formulation :confused:, I simply don't get it why it does that