0

I am completely new to Windows. I setup an automation framework on a windows XP box. The browsers brought up by the automation process at times hang and there is no way to recover except killing the browser window. What is a good programmatic solution to this, or a DOS script that can be used to accomplish the same?

Thanks

1

2 Answers 2

1

It wouldn't be easy to script. But you can get the window handle using GetWindow and then call the function IsHungAppWindow. It would be an easy program to write in c# or vb.net

1

Try monitoring the browser thread state using VBScript. Here's an example directly from MSDN:

Set objDictionary = CreateObject("Scripting.Dictionary")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_Process")
For Each objProcess in colProcesses
objDictionary.Add objProcess.ProcessID, objProcess.Name
Next
Set colThreads = objWMIService.ExecQuery("SELECT * FROM Win32_Thread")
For Each objThread in colThreads
intProcessID = CInt(objThread.ProcessHandle)
strProcessName = objDictionary.Item(intProcessID)
Wscript.Echo strProcessName & VbTab & objThread.ProcessHandle & VbTab & objThread.Handle & VbTab & objThread.ThreadState
Next

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .