Dialog-based app, always minimized 
Author Message
 Dialog-based app, always minimized

I'm creating a server-only application that I'd like to use the dialog-based
AppWizard for. I want to start the application invisible (actually as a
system tray icon) and it should stay that way for its lifetime. I added a
NOTIFYICONDATA member to the CDialog-based class and init it during
OnInitDialog(). I've cleared the Visible checkbox from the dialog
Properties - More Styles tab.

From ::OnInitDialog() I've tried:

ShowWindow( SW_MINIMIZE );
        PostMessage( WM_SIZE, SW_MINIMIZE, 0L);

Neither work - the main dialog shows up as visible. Should this be located
in a different event handler? Sugestions?



Fri, 05 Oct 2001 03:00:00 GMT  
 Dialog-based app, always minimized

http://www.mooremvp.freeserve.co.uk/


Fri, 05 Oct 2001 03:00:00 GMT  
 Dialog-based app, always minimized

Quote:

>Neither work - the main dialog shows up as visible. Should this be located
>in a different event handler? Sugestions?

I have sample code both for creating an invisible dialog-based app and
placing an icon in the system tray on my web site. See tips 1 and 26
on the Win32 code page of my site. The URL is in my sig below.

Bob Moore [MVP]
http://www.mooremvp.freeserve.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to an unreasonable amount of queries, I no
longer answer unsolicited email questions. Sorry,
no exceptions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Fri, 05 Oct 2001 03:00:00 GMT  
 Dialog-based app, always minimized
Kristopher,

Place the  ShowWindow(SW_MINIMIZE); in your CDialogs:::OnInitDialog()
function

BOOL CDialogOnlyDlg::OnInitDialog()
{

  :
  :
  :

 ShowWindow(SW_MINIMIZE);

 return TRUE;  // return TRUE  unless you set the focus to a control

Quote:
}

Charles Steinhardt[MVP]
(To Email: remove NO_SPAM_NO from return address)


Sat, 06 Oct 2001 03:00:00 GMT  
 Dialog-based app, always minimized
Well, if you want a program that runs in the system tray, there is an
excellent class for this at www.codeguru.com.  But to do this, you start
with an SDI application and strip out the CDoc and CView classes.

If you want to stick with the minimize dialog idea, try making the dialog
modeless.  Create the dialog but keep it invisible, minimize it, and then
show it.  There is code for modeless dialogs all over the place, including
www.codeguru.com and VC online docs.

Quote:

>I'm creating a server-only application that I'd like to use the
dialog-based
>AppWizard for. I want to start the application invisible (actually as a
>system tray icon) and it should stay that way for its lifetime. I added a
>NOTIFYICONDATA member to the CDialog-based class and init it during
>OnInitDialog(). I've cleared the Visible checkbox from the dialog
>Properties - More Styles tab.

>From ::OnInitDialog() I've tried:

>ShowWindow( SW_MINIMIZE );
> PostMessage( WM_SIZE, SW_MINIMIZE, 0L);

>Neither work - the main dialog shows up as visible. Should this be located
>in a different event handler? Sugestions?



Sat, 06 Oct 2001 03:00:00 GMT  
 
 [ 5 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. Again: minimizing dialog-based app on startup....

5. Detect when dialog-based app is minimized?

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