Correct CmdShow Parameter     D2 D3
This code snippet shows how to honor the startup window size passed by Windows. Delphi ignores this code, which is supposed to be stored in the System unit CmdShow variable. The RTL source simply initializes it to SW_SHOWDEFAULT and then never does anything else with it.
{ Add the following declaration to your main form's public declaration section }
  RealCmdShow: word;

{ Add the following code to your main form's OnCreate event handler }

  procedure TForm1.FormCreate(Sender: TObject);
  var
    SUI: TStartupInfo;
  begin
    if CmdShow = SW_SHOWDEFAULT then begin
      GetStartupInfo(SUI);
      RealCmdShow := SUI.wShowWindow;
    end else
      RealCmdShow := CmdShow ;

    if RealCmdShow = SW_SHOWMAXIMIZED then
      WindowState := wsMaximized;
  end;

{ Add the following code to your main form's OnActivate event handler }

  procedure TForm1.FormActivate(Sender: TObject);
  begin
    case RealCmdShow of
      SW_SHOWMINIMIZED,
      SW_MINIMIZE,
      SW_SHOWMINNOACTIVE:
        Application.Minimize;
    end;
  end;