程序可以在隱藏狀態欄全屏顯示和原始狀態顯示之間切換 [delphi] unit Unit13; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm13 = class(TForm) btn1: TButton; procedure btn1Click(Sender: TObject); private { Private declarations } L, T, W, H : integer; public { Public declarations } end; var Form13: TForm13; implementation {$R *.dfm} procedure TForm13.btn1Click(Sender: TObject); begin if Self.BorderStyle = bsNone then begin www.2cto.com Showwindow(Findwindow('Shell_TrayWND',nil), SW_SHOWDEFAULT); Self.Left := L; self.Top := T; Self.Width := W; self.Height := H; Self.BorderStyle := bsSizeable; end else begin Showwindow(Findwindow('Shell_TrayWND',nil), SW_HIDE); L := Self.Left; T := self.Top; W := Self.Width; H := self.Height; Self.width:=screen.width; Self.height:=screen.height; Self.Top := 0; Self.Left := 0; Self.BorderStyle := bsNone; end; end; end.