|
-
Feb 27th, 2007, 05:39 PM
#1
Thread Starter
Frenzied Member
[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?
-
Feb 27th, 2007, 06:24 PM
#2
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.
-
Feb 27th, 2007, 08:40 PM
#3
Thread Starter
Frenzied Member
Re: [2005] How to tell if an app was started from a shortcut?
I want to be like you.
Thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|