我检查了N次了,应该没错的呀!请高手帮我看看好吗?
原代码:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel; private{ Private declarations }procedure QueryEndSession(var Msg:TMessage);Message WM_QueryEndSession; public{ Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.QueryEndSession(var Msg:TMessage);beginMsg.Result:=0;end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
application.Minimize;
Tray.InstIcon(application.Icon,self.Handle,0);
end;
end.
原代码:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel; private{ Private declarations }procedure QueryEndSession(var Msg:TMessage);Message WM_QueryEndSession; public{ Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.QueryEndSession(var Msg:TMessage);beginMsg.Result:=0;end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
application.Minimize;
Tray.InstIcon(application.Icon,self.Handle,0);
end;
end.
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);//这个FormCloseQuery定义哪里去了?加上这个就好了private