function IsHung(theWindow: Hwnd; timeOut: LongInt): Boolean; 
var 
  dwResult: DWord; 
begin 
  Result:= SendMessageTimeOut(theWindow, WM_NULL, 0, 0 , 
    SMTO_ABORTIFHUNG or SMTO_BLOCK, timeOut, dwResult) <> 0; 
end; 
you can use FindWindow() function to get Handle of Window. 
timOut is in Miliseconds.

0 comments:
Post a Comment