[RESOLVED] [2005] How to tell if an app was started from a shortcut?
I am trying to get my program to start minimized when set to load when windows loads. Is there a way to find out if it started from a shortcut?
There aren't any additional arguments when starting through a .lnk to look for as tested with Environment.GetCommandLineArgs()
------------------------
EDIT: Or is there an easy way to know if Windows is just starting?
Re: [2005] How to tell if an app was started from a shortcut?
If you're starting your app form a shortcut in the Startup folder then you can set a property of the shortcut to start normal, maximised or minimised. If you want your app to do it specifically then YOU have to add a commandline argument.
I had an application that had CheckBoxes in the Options dialogue for "Start with Windows" and "Minimise at Windows Startup". Obviously the second option was not available if the first wasn't checked. If the first option was selected I'd add a value to the Run registry key containing Application.ExecutablePath. If the second option was selected too I'd add "-min" to the commandline. When my app started up I'd then check the commandline arguments and if I found "-min" I'd minimise my startup form.
Re: [2005] How to tell if an app was started from a shortcut?
I want to be like you.
Thanks again!