timmay3141
Programmer
I'm running a full screen app using Direct3D (not sure if this is important or not). When I alt+tab out, I want the window to minimize. It does this on its own sometimes, but part of the time it sits there, maximized, and won't give up focus to other windows. I want to get it to minimize every time. Here's what I have in the WindowProc:
switch(msg)
{
case WM_ACTIVATE:
Activate((BOOL)wParam); // Handle DX related activation
if(wParam == FALSE)
{
ShowWindow(hwnd, SW_MINIMIZE);
return 0;
}
else
{
ShowWindow(hwnd, SW_MAXIMIZE);
return 0;
}
break;
// handle other messages
}
It generally minimizes the window, but then it inexplicably reactivates and maximizes the window again most of the time, so I can't get the stupid window to stay minimized. What can I do to fix this problem?
switch(msg)
{
case WM_ACTIVATE:
Activate((BOOL)wParam); // Handle DX related activation
if(wParam == FALSE)
{
ShowWindow(hwnd, SW_MINIMIZE);
return 0;
}
else
{
ShowWindow(hwnd, SW_MAXIMIZE);
return 0;
}
break;
// handle other messages
}
It generally minimizes the window, but then it inexplicably reactivates and maximizes the window again most of the time, so I can't get the stupid window to stay minimized. What can I do to fix this problem?