Starting dialog based application minimised 
Author Message
 Starting dialog based application minimised

Hello All

I would like to start my dialog based application minimised and have an
icon appear in the system tray under Windows 95 and Windows NT4.  I have
currently achieved this by sending myself on startup and soon after the
application minimises itself into the system tray.  Although this does
work, I am sure there is a cleaner method.

Any help would be appreciated.

Regards,
        Paul


WWW   : http://www.*-*-*.com/ ~paul_git/



Wed, 03 Nov 1999 03:00:00 GMT  
 Starting dialog based application minimised

Use ShowWindow(SW_MINIMIZE) in your OnInitDialog() as follows:

BOOL CMinimizedDlg::OnInitDialog()
{
        CDialog::OnInitDialog();

        // Add "About..." menu item to system menu.

        // IDM_ABOUTBOX must be in the system command range.
        ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
        ASSERT(IDM_ABOUTBOX < 0xF000);

        CMenu* pSysMenu = GetSystemMenu(FALSE);
        if (pSysMenu != NULL)
        {
                CString strAboutMenu;
                strAboutMenu.LoadString(IDS_ABOUTBOX);
                if (!strAboutMenu.IsEmpty())
                {
                        pSysMenu->AppendMenu(MF_SEPARATOR);
                        pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
                }
        }

        // Set the icon for this dialog.  The framework does this automatically
        //  when the application's main window is not a dialog
        SetIcon(m_hIcon, TRUE);                 // Set big icon
        SetIcon(m_hIcon, FALSE);                // Set small icon

        // TODO: Add extra initialization here
        ShowWindow(SW_MINIMIZE);  // THIS STARTS YOUR DIALOG BASED APPLICATION
MINIMIZED
        return TRUE;  // return TRUE  unless you set the focus to a control

Quote:
}

Vinay



Quote:
> Hello All

> I would like to start my dialog based application minimised and have an
> icon appear in the system tray under Windows 95 and Windows NT4.  I have
> currently achieved this by sending myself on startup and soon after the
> application minimises itself into the system tray.  Although this does
> work, I am sure there is a cleaner method.

> Any help would be appreciated.

> Regards,
>         Paul


> WWW   : http://www.cix.co.uk/~paul_git/



Thu, 04 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Start a dialog based application minimized

2. Starting a Dialog based application (MFC)

3. HOWTO: hide dialog when a dialog-based app starts

4. Start selection dialog before the application starts ...

5. Adding Another MFC Dialog to the Dialog base application

6. Trapping Keystrokes in a Dialog Box or Dialog based application

7. Executing modal tabbed dialog from a dialog-based application

8. Positioning of dialogs in a dialog based application

9. Replacing the dialog box of a dialog-based application

10. Trapping Keystrokes in a Dialog Box or Dialog based application

11. Printing a Dialog Box from a Dialog-Based Application

12. Help please - Dialog-based app won't start - Acc Vio C0000005 - VC 5 - Win200

 

 
Powered by phpBB® Forum Software