views:

471

answers:

1

Hi,

I have a MFC app without main window. When users start it, it displays the splash screen for 1~2 seconds, then splash screen fades out to system tray. Users start to access the menu by clicking the icon in the tray.

The app can also auto start when users login to Windows (adding entry in Start Up folder). The same process described above repeats. I think the splash screen is kind of bothering during auto starts. I like to hide the splash screen when it auto starts, but keep splash screen shown if users manually run the app. I wonder what is the best way to do this?

Thanks a lot!

+3  A: 

A simple way would be to set a shortcut to the application in the Startup folder that specifies a parameter on the command line, e.g. if your application is called myapp.exe in the shortcut properties you could type <path to myapp>\myapp.exe -nosplash.

Then modify your application code to check the command line parameters possibly with
GetCommandLine to see if -nosplash had been passed and then not display the splash screen. Obviously, if the user had just launched it by doubling clicking the application itself, -nosplash would not be present and it would display the splash screen as normal.

porkchop
Thank you so much! It is a good and simple idea.
bionicoder