Windows - 窗口状态(运行与不响应) [英] Windows - window status (Running vs Not Responding)

查看:246
本文介绍了Windows - 窗口状态(运行与不响应)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何确定窗口状态(运行与否

响应)?我尝试了各种方法但没有成功...


这将适用于各种Windows系统,但至少都是XP,

和主要是服务器2003.每个人都有Python 2.5.1,并且脚本将在本地运行。


任何想法?

解决方案

4月11日下午1:45,rdahlstrom< roger.dahlst ... @ gmail.comwrote:


有谁知道如何确定窗口状态(运行与否

响应)?我尝试了各种方法但没有成功...


这将适用于各种Windows系统,但至少都是XP,

和主要是服务器2003.每个人都将拥有Python 2.5.1,并且脚本将在本地运行



任何想法?



基本上,我正在寻找类似于System.Diagnostics中的Process.Responding

属性......


rdahlstrom写道:


4月11日下午1点45分,rdahlstrom< roger.dahlst ... @ gmail.comwrote:


>有谁知道如何确定窗口状态(运行与否
响应)?我已经尝试了各种方法但没有成功......

这将适用于各种Windows系统,但至少都是XP,主要是服务器2003.每个人都会有Python 2.5.1关于它们,并且脚本将在本地运行。

任何想法?




基本上,我正在寻找类似于System.Diagnostics中的Process.Responding

属性的东西。 。



一个(略微激烈)的可能性可能是使用IronPython [1]

或Python.NET [2]来调用.Net功能直接。 AFAIK那里

没有直接的选择:我相信WMI可以是一个有用的匹配

for System.Diagnostics但是没有处理windows(即用户界面

元素)。大概你可以找到每个

过程的顶级窗口,使用模糊的东西[3]再加上这个[4]

并发送一个合适的SendMessage到"平"它。 Haven不是自己做的

但是不知道为什么它不起作用。


所有有点手动但也许它''将你指向某个地方...


TJG


[1] http://www.codeplex.com/Wiki/View.as...ame=IronPython

[2] http://pythonnet.sourceforge.net/

[3] http://timgolden.me .uk / python / wmi_co ... ning_processes

[4]
http://timgolden.me.uk/python/win32_...ubprocess.html


4月11日下午2:10,rdahlstrom< roger.dahlst ... @ gmail.comwrote:

4月11日下午1点45分,rdahlstrom< roger.dahlst ... @ gmail.comwrote:


有谁知道如何确定窗口状态(运行与否

响应)?我尝试了各种方法但没有成功...


这将在各种Windows系统上,但至少都是XP,

,主要是服务器2003.每个人都有Python 2.5.1,而脚本将在本地运行。


有什么想法吗?



基本上,我正在寻找类似于System.Diagnostics中的Process.Responding

属性...



嗯......我想你应该重新发布到Python win32组。他们会知道答案,如果有的话,他们会知道答案。以下是注册的链接:
http ://mail.python.org/mailman/listinfo/python-win32

另外,您可以查看WMI模块:

http://tgolden.sc.sabren.com/python/ wmi.html


我很确定它能做到这一点,但我不知道怎么做。我确实找到了一篇

的文章:

http://www.informit.com/articles/art...19489&seqNum=4


如果你比我好,你可以把它翻译成

Python等价物。 Zenoss还有一些监控软件,它们是开源Python代码。


Mike


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?

解决方案

On Apr 11, 1:45 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:

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...


rdahlstrom wrote:

On Apr 11, 1:45 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:

>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.as...ame=IronPython
[2] http://pythonnet.sourceforge.net/
[3] http://timgolden.me.uk/python/wmi_co...ning_processes
[4]
http://timgolden.me.uk/python/win32_...ubprocess.html


On Apr 11, 2:10 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:

On Apr 11, 1:45 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:

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...

Hmmm...I think you should re-post to the Python win32 group. They''ll
know the answer, if there is one. Here''s the link to get signed up:
http://mail.python.org/mailman/listinfo/python-win32

Also, you might take a look at the WMI module:

http://tgolden.sc.sabren.com/python/wmi.html

I''m pretty sure it can do that, but I don''t know how. I did find an
article on it:

http://www.informit.com/articles/art...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.

Mike


这篇关于Windows - 窗口状态(运行与不响应)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆