- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 检测应用程序是否已停止响应
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;