全部博文(788)
分类:
2008-09-16 14:57:51
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
ApplicationEvents1: TApplicationEvents;
procedure ApplicationEvents1Minimize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ApplicationEvents1Minimize(Sender: TObject);
begin
//这里写
end;
end.
可以用一个时间控件,判断是否被最小化,就行了...
public
{ Public declarations }
procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if (Msg.CmdType = SC_MINIMIZE) or (Msg.CmdType = SC_MAXIMIZE) then
begin
// your code ............
showmessage('hello');
end;
DefaultHandler(Msg);
end;
madyak的方法好像不行,可能是我这边程序的问题,用hongqi162的方法搞定了,感谢各位!
给分
ApplicationEvents1
是控件面板上additional上的一个组件