本文整理自网络,侵删。
用Timer实现的 找寻窗口的句柄 然后发送关闭消息,再把时间线给关掉
在用的时候记得里面的'test'改成弹出的标题就对了
嘿嘿Timer默认时间是1秒哦 记得改掉 至少要3秒吧
在private里面定义
Delphi代码
private
{ Private declarations }
tmphandle:Thandle;
Delphi代码
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;
相关阅读 >>
Delphi shellexecute调用系统命令关闭计算机
Delphi 判断图像格式bmp jpg gif pcx png psd ras sgi tiff err
Delphi中通过tclientsocket获取公网(wan)ip地址
用Delphi通过setupapi.dll列举和停用硬件设备
Delphi 手机app打开一个安卓系统支持的文件,比如 pdf
更多相关阅读请进入《Delphi》频道 >>