4

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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
yuval
  • 2,848
  • 4
  • 31
  • 51

2 Answers2

7

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;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
1

You can use this code.

procedure MinimizeBtnClick(Sender: Tobject);
begin
 SendMessage(WizardForm.Handle,$112,61472,0);
end;
James Adam
  • 29
  • 2
  • That's exactly the same code as my answer shows. You have just used hexadecimal notation, where I've used decimal notation, and vice versa. – Martin Prikryl May 19 '17 at 06:30
  • Im sorry mr. According to me, in programming we can use many different codes but all it same means. So, please appreciate people to answer a question. Thanks sorry if i distrub you – James Adam May 20 '17 at 21:51