Tuesday, December 16, 2008

restoring app also restores iconic tool dialogs


void CToolDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
// When an iconic app is restored, by default any iconic modeless dialogs
// it owns are also restored. Clobbering their iconic states clutters the
// screen, and violates the expectation that a restored app should appear
// just as it did when it was minimized. The workaround is to skip CWnd's
// behavior in this case, and rely on the main frame to hide and show any
// iconic modeless dialogs.
if (nStatus && IsIconic()) // if parent opening/closing and we're iconic
return; // do nothing
CPersistDlg::OnShowWindow(bShow, nStatus);
}

Thanks:
Kevin
Jim
Walter
Andy
Katya

No comments: