views:

176

answers:

1

In our C# application we use the RDP viewer as an ActiveX control. The application has its own toolbar with a Ctrl+Alt+Del button. There does not seem to be a method on the ActiveX control to perform this function. I know you can hit Ctrl+Alt+End on your keyboard which is fine but how do I do that from the toolbar button click?

+1  A: 

Try to use the SendKeys class.

In this example, you could send Ctrl+Alt+End as this:

 SendKeys.Send("(^%{END})");
Magnus Johansson
The problem with SendKeys is that is does not work correctly under vista UAC. .NET 3 runtime addresses this but I am tied to .NET 2 right now. See SendKeys MSDN docs for further information.
Kevin
Weel, then you probably only have 2 choices. Either upgrade to .NET v3.5 (good) or disable UAC (bad).
Magnus Johansson
don't you dare disable UAC :) seriously, what you're seeing with SendKeys is totally by design. @Magnus is correct, upgrade to 3.5
Michael Howard-MSFT