Windows - window status (Running vs Not Responding)

Mike Driscoll kyosohma at gmail.com
Fri Apr 11 17:11:04 EDT 2008


On Apr 11, 3:22 pm, Tim Golden <m... at timgolden.me.uk> wrote:
> 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

Tim,

Oh well. I guess my Google-Fu failed me this time around. Thanks for
looking at it though.

Mike



More information about the Python-list mailing list