On Apr 11, 3:46 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > rdahlstrom wrote: > > On Apr 11, 1:45 pm, rdahlstrom <[EMAIL PROTECTED]> wrote: > >> Does anyone know how to determine the window status (Running or Not > >> Responding)? I've tried various methods with no success... > > >> This would be on a variety of Windows systems, but all at least XP, > >> and mostly server 2003. Everyone will have Python 2.5.1 on them, and > >> the script would be running locally. > > >> Any ideas? > > > Basically, I'm looking for something similar to the Process.Responding > > property in System.Diagnostics... > > Well one (slightly drastic) possibility might be to use IronPython [1] > or Python.NET [2] to invoke the .Net functionality directly. AFAIK there > is no direct alternative: I believe that WMI can be a useful match > for System.Diagnostics but doesn't deal with windows (ie user-interface > elements). Presumably you could find a top-level window for each > process, using something vaguely like this [3] coupled with this [4] > and send it a suitable SendMessage to "ping" it. Haven't done it myself > but can't see why it shouldn't work. > > All a bit handwavey but maybe it'll point you somewhere... > > TJG > > [1]http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython > [2]http://pythonnet.sourceforge.net/ > [3]http://timgolden.me.uk/python/wmi_cookbook.html#running_processes > [4]http://timgolden.me.uk/python/win32_how_do_i/find-the-window-for-my-s...
I had actually contemplated using ctypes and linking the .dll directly, but even though I'm running 32 bit Python, some of the machines that I want to run this on are 64 bit windows, so it doesn't work. If I get desperate, I'll check out IronPython, but I'd really like to stay (as much as possible) with our standard package (2.5.1 with wmi/win32) -- http://mail.python.org/mailman/listinfo/python-list