• Breaking News

    Panduan dan Tutorial Lengkap serta Materi Pelajaran di Mulyono Blog. Konten Terlengkap dan Terpercaya

    Selasa, 20 September 2011

    Minimize semua windows

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;

    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.DFM}

    procedure TForm1.Button1Click(Sender: TObject);
    var
       h : HWnd;
    begin
         h:=handle;
         while h > 0 do
         begin
              if IsWindowVisible(h) then
                 Postmessage(h,WM_SYSCOMMAND,SC_MINIMIZE,0);
              h:=GetnextWindow(h,GW_HWNDNEXT);
         end;
    end;