procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> str ,str1,str2: string;<br> hwndclose1,hwndclose,hwndclose2,hwndclose3,hwndclose4 : Hwnd;<br>begin<br> str1 := '不安全的设备删除';<br> hwndclose2 := FindWindow(nil,PChar(str1));<br> if hwndclose2 &lt;&gt; 0 then<br> SendMessage(hwndclose2,wm_close,0,0);<br> str2 := 'NetworkController'; // str2是可执行文件的文件名<br> hwndclose3 := FindWindow(nil,Pchar(str2));<br> hwndclose4 := GetLastActivePopup(hwndclose3);<br> if hwndClose3 = hwndclose4 then<br> if hwndclose4 &lt;&gt; 0 then<br> SendMessage(hwndclose4,wm_close,0,0);<br><br> str := 'DFJK'; // 杀DFJK 子窗体<br> hwndclose1 := FindWindow(nil,Pchar(str));<br> hwndclose := GetLastActivePopup(hwndclose1);<br> if hwndClose &lt;&gt; hwndclose1 then exit;<br> if hwndclose &lt;&gt; 0 then<br> SendMessage(hwndclose,wm_close,0,0);<br>end;