如何检测任务栏上的右键单击
我有一个 C# 语言的 Windows 窗体应用程序,它以加载对话框开始。正如预期的那样,该应用程序的按钮会显示在 Windows 任务栏中。
我想检测可能对该按钮进行的右键单击。
最终,我希望禁用右键单击或只是让加载对话框重新获得焦点。我看到有些人使用自定义库和包(例如互操作)来实现某些 Win32 功能,但我个人希望避免这种情况。没有这样的库/包就不可能吗?
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将
Form.ShowInTaskbar
设置为 false 来不在任务栏中显示表单怎么样?How about just not showing the form in the taskbar by setting
Form.ShowInTaskbar
to false?