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...
You know, I thought about sending it a message, but I found that, in testing, I am able to move, resize, and copy text from a "Not Responding" window. I was having a tough time figuring out a suitable message that I could send a generic window, one that I had no idea about what it had available to me. Other than sending it a graceful exit message (which I really don't want to do), have you any ides about what to send it? -- http://mail.python.org/mailman/listinfo/python-list