I am developing a Forms application that is either supposed to start on Windows boot (by registering a key in the registry) or by the actual user.

In case the user starts it by hand (i.e. clicking the executable file), I want the form to show up. In case Windows triggered the event, I want the application to be hidden (into the tray bar).

Is there a way to programmatically determine which of those cases occured?