本文整理自网络,侵删。
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 使用webbrowser控件获取含框架的网页的完整html代码
Delphi sysutils.comparestr、sysutils.comparetext - 字符串比较
Delphi xe mysql数据库操作类 mysqlhelper
更多相关阅读请进入《Delphi》频道 >>