Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi,
I have a winforms application that opens up on Windows startup. However in this case I would like it to stay in the traybar and not to pop up. But if a user starts it, it should pop up. How do I find out how was the application run? if by user or automatically by Windows?

Thank you
Cheers
Posted

1 solution

For your program shortcut that is run on start up, pass in a parameter like "-autostart" as a command line parameter. For normal user startup you will not pass in this parameter. The program can then easily check its parameters to determine if it should start in the traybar or not.
 
Share this answer
 

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