Windows - window status (Running vs Not Responding)

Tim Golden mail at timgolden.me.uk
Fri Apr 11 16:22:18 EDT 2008


Mike Driscoll wrote:
> http://www.informit.com/articles/article.aspx?p=19489&seqNum=4
> 
> If you're better than I am, you can probably translate this to the
> Python equivalent. Zenoss also has some monitoring software that's
> open source Python code.

I'm afraid that article only allows you to determine whether
a known executable is running, If that's what the OP's after,
then you can do as much by querying WMI thusly:

<code>
import wmi
c = wmi.WMI ()

EXE = "notepad.exe"
for process in c.Win32_Process (Caption=EXE):
   print process
   break
else:
   print "None found"

</code>

TJG



More information about the Python-list mailing list