views:

125

answers:

1

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?

+1  A: 

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

Jason Punyon
Thanks! That's a great solution, just what I needed. Now, if I were looking to also do the same thing in a WPF application, do you know if it's also possible? It seems there's no property for that.Since I didn't mention it, it is indeed a bad idea to disable right-click in some user-disabling way that affects the rest of the user's operations. The intention is to either disable it for my application's button or to have my app get around the action. Feel free to reiterate this, but please also supply some useful information about a better solution, as well, if you choose to do so.
Danny