Is there any way to detect then override the Windows Shortcut param run Minimized?
I want to detect if the shortcut is wanting to start the program minimized then handle the Minimize/maximize/normal sizing myself later.
I have a splash screen that I create using
Form_Splash := TForm_Splash.Create(Application);
the I create the main form later using
Application.CreateForm(TForm_main, Form_main);
after the main form is displayed I destroy the form_Splash and at that time I want to minimize/maximize/normal size the form_main based on what the windows shortcut requested.
Thanks for any help.
Steve…
You can use the
GetStartupInfoAPI call to get theSTARTUPINFOpassed to your process on creation (TStartupInfoin Delphi). ThewShowWindowmember contains the desired initial show state.What is always good to know is:
So for whatever window
ShowWindowis first called, the value specified in the startup info record will be used. This could affect your splash screen.But in any case – you can use the value from the
STARTUPINFOto have your main form acting accordingly.Personally I would hate the application showing me the splash screen when I want it to start minimized. Usually these applications also steal my input focus which drives me mad.