In my application, I have an option to start the application when Windows is started. That works great. I also have it so that, when minimized, the application is minimized to the system tray. Is there a way that I could have it be automatically minimized when started up at the same time as Windows? The only way I could think of, is to retrieve the amount of time that they system has been on and use that data to decide whether the machine had recently started. Obviously there are a lot of flaws with that theory. Anybody have any other ideas as to how this could be done?
Implement a command line switch in your program that causes your program to minimize to the tray. When you start the program with Windows startup, just include the switch.
http://msdn.microsoft.com/en-us/library/acy3edy3.aspx
In your Form "Properties" in WindowState change to "Minimized", or in code:
//After this:
InitializeComponent();
//Place this line:
WindowState = FormWindowState.Minimized;
Hope this help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With