Search code examples
inno-setuppascalscript

How do I minimize my installer in Inno Setup?


I created my own custom minimize button in Inno Setup.

I would like to know how to minimize my installer when I click on it.

The minimize should be just like the default minimize button on the border of the installer.


Solution

  • To simulate a click on the minimize button in a window title, send WM_SYSCOMMAND message to the installer wizard form using the PostMessage support function:

    const
      WM_SYSCOMMAND = 274;
      SC_MINIMIZE = $F020;
    
    procedure MinimizeButtonClick(Sender: TObject);
    begin
      PostMessage(WizardForm.Handle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
    end;