Browse Source

Make sure New Disk form always has a taskbar button.

Jordan Russell 8 months ago
parent
commit
54b7211300
1 changed files with 11 additions and 0 deletions
  1. 11 0
      Projects/Src/Setup.NewDiskForm.pas

+ 11 - 0
Projects/Src/Setup.NewDiskForm.pas

@@ -30,6 +30,8 @@ type
     { Private declarations }
     Filename: string;
     function GetSanitizedPath: String;
+  protected
+    procedure CreateParams(var Params: TCreateParams); override;
   public
     { Public declarations }
     constructor Create(AOwner: TComponent); override;
@@ -88,6 +90,15 @@ begin
   FlipSizeAndCenterIfNeeded(Assigned(WizardForm), WizardForm, False);
 end;
 
+procedure TNewDiskForm.CreateParams(var Params: TCreateParams);
+begin
+  inherited;
+  { Make sure the form gets a taskbar button if WizardForm doesn't exist yet
+    or if it isn't visible because it's a very silent install }
+  if (WizardForm = nil) or not WizardForm.Visible then
+    Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
+end;
+
 function TNewDiskForm.GetSanitizedPath: String;
 begin
   Result := PathExpand(RemoveBackslashUnlessRoot(Trim(PathEdit.Text)));