本文整理自网络,侵删。
procedure TForm2.Button1Click(Sender: TObject);var H : THandle; lngReturnValue : longint; DWResult : DWORD;begin H := FindWindow('Notepad', nil); if H > 0 then begin lngReturnValue := SendMessageTimeout( H, WM_NULL, 0, 0, SMTO_ABORTIFHUNG And SMTO_BLOCK, 1000, DWResult );//delphitop.com if lngReturnValue > 0 then ShowMessage('响应') else ShowMessage('Not 响应'); end else ShowMessage('Application not found');end;
相关阅读 >>
Delphi几个进制相关的代码(hextoint、hextoasc)
Delphi idhttpserver接收http get请求解码问题
如何使用Delphi 10 seattle的android应用做intent的发送和接收
更多相关阅读请进入《Delphi》频道 >>