jksyuen

Minimize 2nd form to taskbar

Apr 2nd, 2018
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.59 KB | None | 0 0
  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
  7.  
  8. type
  9.   TForm2 = class(TForm)
  10.   private
  11.     { Private declarations }
  12.   public
  13.     { Public declarations }
  14.     procedure CreateParams(var Params: TCreateParams); override;
  15.   end;
  16.  
  17. var
  18.   Form2: TForm2;
  19.  
  20. implementation
  21.  
  22. {$R *.DFM}
  23.  
  24. procedure TForm2.CreateParams(var Params: TCreateParams);
  25. begin
  26.   inherited;
  27.   if (FormStyle = fsNormal) then begin
  28.     Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
  29.     Params.WndParent := GetDesktopWindow;
  30.   end;
  31. end;
  32.  
  33. end.
Advertisement