随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
  protected
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
  case Message.CmdType of
    SC_CLOSE: begin
                Perform(WM_SYSCOMMAND, SC_MINIMIZE, 0);
                Exit;
              end;
  end;
  inherited;
end;

end.

posted on 2008-10-31 16:57  万一  阅读(...)  评论(...编辑  收藏