Hello,
I'm making an application in Visual C++ that hides/shows an application window from taskbar by clicking a button.
First problem (googled it) is that I don't know how to retrieve the information about a window state (SW_HIDE,SW_SHOWNORMAL, etc.). Is it hidden, minimized, normal or maximized? I only know how to set them. I want this information to toggle between hide/show states.
Second problem more difficult is that showing back a normal window maximized or normal works fine BUT if that window is used by a game I can't restore directly in the fullscreen video mode - I see only my screen as it is at the moment and no mouse pointer (as it would focus that window but does not retrieve the fullsceen game mode).
Here's my function for hiding from taskbar:
void hide(char* className, char* windowTitle)
{
HWND hc = FindWindow(className,windowTitle);
if(hc == NULL) MessageBoxA(NULL,"Cannot find the window","Error",MB_OK);
else
{
ShowWindow(hc,SW_HIDE);
SetForegroundWindow(hc);
MessageBoxA(NULL,"We retrieve the window to normal state","OK",MB_OK);
ShowWindow(hc,SW_SHOWNORMAL);
SetForegroundWindow(hc);
}
}