var
hExeHandle: HWND;
Res: DWORD;
lResponding:Boolean;
begin
hExeHandle := FindWindow(nil, 'HL9000_Monitor_Update');
if hExeHandle<>0 then
begin
if SendMessageTimeout(hExeHandle, WM_NULL, 0, 0, SMTO_NORMAL, 100, Res) <> 0 then // 程序未死, 参数100表示等100ms
lResponding:=True;
end;
//判断窗口是否响应for NT++
function IsAppRespondingNT(wnd: HWND): Boolean;
type
TIsHungAppWindow = function(wnd:hWnd): BOOL; stdcall;
var
hUser32: THandle;
IsHungAppWindow: TIsHungAppWindow;
begin
Result := True;
hUser32 := GetModuleHandle('user32.dll');
if (hUser32 > 0) then
begin
@IsHungAppWindow := GetProcAddress(hUser32, 'IsHungAppWindow');
if Assigned(IsHungAppWindow) then
begin
Result := not IsHungAppWindow(wnd);
end;
end;
end;