Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Simulate Ctrl+Alt+Del Sendkeys

all is said in the title, how can I simulate the combination Ctrl+Alt+DEL?

I tried this:

SendKeys.Send("^(%({DEL}))")
SendKeys.Send("^(%{DEL})") 
SendKeys.Send("^%{DEL}")

But none worked. I am working on VB.NET and Windows XP SP3

like image 642
GianT971 Avatar asked Feb 18 '11 22:02

GianT971


3 Answers

As of Windows Vista, you can use the SendSAS function.


Original answer, now superseded by the above

The function you need is called SimulateSAS. You need to e-mail [email protected] and ask for it. Microsoft don't appear to document this, but just do a websearch for SimulateSAS and you'll see what I mean.

Others have explained why it's actually not a security issue to allow apps to trigger CTRL+ALT+DEL, but you certainly can't do it with SendKeys.

like image 53
David Heffernan Avatar answered Nov 10 '22 23:11

David Heffernan


You can't. This is done at the device driver level, you can't fake input for the keyboard driver. Also the reason you cannot disable it. Allowing it to be faked would of course be a very serious security flaw.

like image 30
Hans Passant Avatar answered Nov 10 '22 22:11

Hans Passant


Your best bet might be to download the TightVNC source code, and see how they do it.

like image 20
Robert Harvey Avatar answered Nov 10 '22 22:11

Robert Harvey