本文整理自网络,侵删。
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 取得开机时间 开机时间总长度(可精确到秒,分钟等)
Delphi runasadmin 运行程序并申请管理员权限
Delphi 中 findwindow 和 findwindowex 的语法和用法
Delphi 怎么将一个流转换成字符串?或者将字符串转出一个流
Delphi 2009 中 tstrings 与 tstream 的增强
Delphi的tservice的windows�入桌面切�q
更多相关阅读请进入《Delphi》频道 >>