单击任务栏上的按钮时,将哪个事件发送到Windows窗体窗口? [英] What event is sent to a Windows Forms window when its button from the taskbar is clicked?

查看:213
本文介绍了单击任务栏上的按钮时,将哪个事件发送到Windows窗体窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户单击任务栏中的窗口标题/按钮时,什么.NET事件(或Windows API消息)发送到窗口?

When the user clicks the window title/button in the taskbar, what .NET event (or Windows API message) is sent to the window?

我正在使用C#/.NET 2.0/Windows窗体.

I'm using C#/.NET 2.0/Windows Forms.

谢谢

推荐答案

要发现在各个点发送到窗口的消息,您应该考虑使用Microsoft Spy ++.在我的机器上,它位于以下路径

To discover the messages that are send to a window at various points you should consider using Microsoft Spy++. On my machine it is located at the following path

"D:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\spyxx.exe" 

请注意,我使用的是64位操作系统,因此是(x86).

Note I am using 64bit OS hence the (x86).

消息的类型和数量很大,我确信在XP和Windows 7之类的OS版本之间消息会略有不同.但是关键事件/消息可能会保持相当恒定.

The type and number of messages is quite big and I am sure varies slightly between OS versions like XP and Windows 7. However the key events/mesages would probably remain pretty constant.

WM_ACTIVATE(激活和停用时) WM_WINDOWPOSCHANGING WM_WINDOWPOSCHANGED 等

WM_ACTIVATE (When activating and deactivating) WM_WINDOWPOSCHANGING WM_WINDOWPOSCHANGED etc.

另一个好工具是ManagedSpy,但是我没有在XP以外的任何工具上尝试过,它似乎不能在Windows 7 64bit上运行,但是我还没有做很多调查(还!). http://msdn.microsoft.com/en-us/magazine/cc163617. aspx

Another good tool is ManagedSpy, but I have not tried it on anything other than XP, it does not seem to run on Windows 7 64bit, but I have not done much investigation (Yet!). http://msdn.microsoft.com/en-us/magazine/cc163617.aspx

这篇关于单击任务栏上的按钮时,将哪个事件发送到Windows窗体窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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