TApplicationEvents和Ttimer结合使用即可
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
Timer1.Enabled := False;
end;
procedure TForm1.ApplicationEvents1Idle(Sender: TObject;
var Done: Boolean);
begin
Timer1.Enabled := True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
form1.Close;
(form1.Parent as Tform).close;
end;
快试试吧
TApplicationEvents在additional组件中
Ttimer设interval为n*60*1000
你也可在ApplicationEvents1Message中再对消息具体进行判断和过滤处理