如何检测鼠标右键单击任务栏上 [英] How to Detect Right Click on the Taskbar

查看:139
本文介绍了如何检测鼠标右键单击任务栏上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体的加载对话开始了在C#应用程序。正如预期的那样,在应用程序中的按钮显示在Windows任务栏上。

I've got a Windows Forms application in C# that starts off with a loading dialog. As expected, a button for the app shows up in the Windows taskbar.

我想检测右键单击,可能需做该按钮。

I would like to detect right-clicks that might be done to that button.

最后,我希望能够禁用右键单击或干脆装对话框重新获得焦点。我见过一些人使用的自定义库和包(互操作等)来实现一些Win32的功能,但我个人比较喜欢避免这种情况。它是不可能做没有这样的库/包?

Ultimately, I hope to disable the right-click or simply have the loading dialog regain focus. I've seen that some people use custom libraries and packages (interop, for example) to achieve some Win32 functionality, but I'd personally like to avoid this. Is it impossible to do without such libraries/packages?

推荐答案

怎么样只是没有显示的形式在任务栏设置 Form.ShowInTaskbar 来假的?

How about just not showing the form in the taskbar by setting Form.ShowInTaskbar to false?

这篇关于如何检测鼠标右键单击任务栏上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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