views:

153

answers:

2

I've got a WPF 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. Furthermore, these libraries/packages appear to be specific to Windows Forms; I've not seen anything for WPF. Is it impossible to manipulate the taskbar's right-click in WPF?

A: 

Can you not just set ShowInTaskbar="False" on the window?

Groky
A: 

You can set ShowInTaskbar="False" on the window, and then once you are done loading set it back to true in code-behind.

Ben Collier