I had the same problem. The best solution I have found is to call ShowWindowShowWindow
with the flag SW_MINIMIZESW_MINIMIZE
, and then with SW_RESTORESW_RESTORE
. :D
Another possible solution: // Code to display a window regardless of its current state ShowWindow(hWnd, SW_SHOW); // Make the window visible if it was hidden ShowWindow(hWnd, SW_RESTORE); // Next, restore it if it was minimized SetForegroundWindow(hWnd); // Finally, activate the window
// Code to display a window regardless of its current state
ShowWindow(hWnd, SW_SHOW); // Make the window visible if it was hidden
ShowWindow(hWnd, SW_RESTORE); // Next, restore it if it was minimized
SetForegroundWindow(hWnd); // Finally, activate the window
from comments at: http://msdn.microsoft.com/en-us/library/ms633548%28VS.85%29.aspx