Windows - window status (Running vs Not Responding)

Tim Golden mail at timgolden.me.uk
Fri Apr 11 21:46:24 CEST 2008


rdahlstrom wrote:
> On Apr 11, 1:45 pm, rdahlstrom <roger.dahlst... at gmail.com> 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-subprocess.html



More information about the Python-list mailing list