Detect when dialog-based app is minimized? 
Author Message
 Detect when dialog-based app is minimized?

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



Wed, 28 Jul 1999 03:00:00 GMT  
 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! "



Wed, 28 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adding a minimize button to an existing dialog based app

2. Starting a Dialog Based app minimized.

3. Dialog-based app starting minimized

4. Dialog-based app, always minimized

5. Again: minimizing dialog-based app on startup....

6. Dialog based app minimize on startup???/

7. Q: Smart Minimize and MFC Dialog Based App

8. property sheet based app: minimize to tray?

9. Minimize Button in Dialogue-based App

10. Resizing a dialog based app based on its view's size

11. Start a dialog based application minimized

12. minimize dialog base application

 

 
Powered by phpBB® Forum Software