I’m writing an application in C++ that runs as a system tray icon. When the application initially starts up the main dialog loads up and takes focus, which isn’t the behavior I intend it to have. Is there a way to load the system tray icon without having the main dialog load up?
Share
If you used the standard mfc project wizard, then the code that displays the dialog is in your applications’s InitInstance method.
Just comment out the
dlg.DoModal()andm_pMainWnd = &dlg;parts and you will be fine.Note that you might have to code your own message loop otherwise your application will just exit after these changes.