unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
tmphandle:Thandle;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
tmphandle:=Findwindow(nil,pchar('test'));
SendMessage(tmphandle,wm_close,0,0);
Timer1.Enabled :=False;
end;procedure TForm1.FormActivate(Sender: TObject);
begin
Application.MessageBox('test','test',0);
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
tmphandle:Thandle;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
tmphandle:=Findwindow(nil,pchar('test'));
SendMessage(tmphandle,wm_close,0,0);
Timer1.Enabled :=False;
end;procedure TForm1.FormActivate(Sender: TObject);
begin
Application.MessageBox('test','test',0);
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货