
Detect when dialog-based app is minimized?
Simply grab the WM_SIZE message and then check if the app is minimizing.
Here is an example to simply do it with a Window app.... you can simply change
this for dialogs if you like.
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if( nType == SIZE_MINIMIZED ){
AfxGetApp()->m_pMainWnd->ShowWindow( SW_HIDE );
}
Quote:
}
Quote:
>Hello,
>I have a dialog based app in which I want to hide the main window when the
>user hits the minimize button (it's using a tray icon). I can't seem to
>find a message that corresponds to this event. I tried OnShowWindow, but
>that doesn't happen when the dialog is minimized. If anyone can tell me how
>to do this (it must be possible), I'd really appreciate it.
>Thanks
>Jeff Kohn
> http://www.*-*-*.com/ ~jkohn
PC'ing you,
Dana M. Epp
http://bedrock.{*filter*}hq.com/dana
"How can one work with the technology of today, using yesterdays
software and methods, and still be on the leading edge tomorrow?
Why settle for less... I won't! "