Click here to Skip to main content
15,884,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello My Dear Friends

I have created an application in C# visual basic 2008, which is starting when System Starts then i am asking for a condition if it is false application get close ..but i want to start my application with an icon on desktop so that user can change the condition required to run application without get closed ........ it means i want to know when user start my application with icon on desktop or start menu.

please Help me ...
Posted
Updated 18-Nov-12 4:48am
v2

You can use my easy-to-use command line parsing library: Enumeration-based Command Line Utility[^].

It is complete with full source code and detailed explanation. Two previous articles explaining the techniques are referenced, as well as one alternative (more complex) command line utility.

—SA
 
Share this answer
 
Comments
Syed Ghulam Ali 19-Nov-12 5:19am    
Thanks Dear for helping me i Got it......and sory for not using ur library but its very effective and even though i had lear a lot from it...
Sergey Alexandrovich Kryukov 19-Nov-12 11:38am    
Not too late, but you can simply learn basic ideas...
You are welcome. Are you going to accept the answer formally (green button)? -- thanks.
--SA
Espen Harlinn 19-Nov-12 19:18pm    
Well replied :-D
Sergey Alexandrovich Kryukov 19-Nov-12 19:29pm    
Thank you, Espen.
--SA
Easiest way is give it a parameter, or argument.
If you check in your Main Method (console type apps), or use Environment.GetCommandLineArgs() for winforms, you can read the parameters passed to the application.

Set up the System Startup version to have an parameter such as "/Automatic" or similar, and you can detect the startup mode pretty easily.
 
Share this answer
 
Comments
Syed Ghulam Ali 18-Nov-12 11:04am    
thankyou for helping me Dear but can u give me a hint code to implement in windows application
OriginalGriff 18-Nov-12 11:16am    
Look at the MSDN description of Environment.GetCommandLineArgs:
http://msdn.microsoft.com/en-us/library/system.environment.getcommandlineargs.aspx
It gives an example.
Syed Ghulam Ali 19-Nov-12 5:17am    
Thanks Dear for helping me ...........
OriginalGriff 19-Nov-12 5:26am    
You're welcome!
Espen Harlinn 19-Nov-12 19:17pm    
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900