JohnOne,
The following worked ...
AdlibRegister("_IsAppCrash",250)
Run("C:abc.exe")
sleep(1000)
send("!vg")
sleep(2000)
Func _IsAppCrash()
if winexists("abc","") then
$HWND=WinGetHandle("abc")
$aHungApp = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $HWND) ; handle of app window must be global for use with Adlib* functions
If @error Then
MsgBox(0, "DllCall Error", @error)
EndIf
If $aHungApp[0]=0 Then
ControlClick("abc.exe","&Close","")
EndIf
Else
exit
endif
EndFunc
I have one more question. Do I have to include this in all the scripts?. Can't we declare this function as global and call it in all the scripts?