玩玩看:
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FOldProc : TWndMethod;
procedure MyProc(var message : TMessage);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
FOldProc := Form1.WindowProc;
FOrm1.WindowProc := MyProc;
Form1.WindowState := wsMaximized;
end;
procedure TForm1.MyProc(var message: TMessage);
begin
if (message.Msg = WM_SYSCOMMAND) and ((message.WParam = SC_MINIMIZE)
or (message.WParam = SC_RESTORE)) then
exit;
FOldProc(message);
end;