views:

831

answers:

4

How do I trap Windows key, Alt+Tab, and Ctrl+Alt+Delete in a Windows application using C#?

A: 

Almost by definition, you can't "trap" ctrl-alt-delete.

unwind
Yes, you can (using a custom GINA). But not in C#.
Kramii
A: 

AFAIK Ctrl + Alt + Delete cannot be captured using an application.

See this question to get some more idea: http://stackoverflow.com/questions/1292165/how-to-lock-the-keyboard-and-mouse-for-a-windows-application-c

Shoban
+3  A: 

You can capture Ctrl-Alt-Delete. But you need to implement your own GINA dll which is loaded by Winlogon.

You'll need to code this up in C or C++ as it needs to be a native DLL.

Jan Bannister
+1  A: 

As Jan stated, you can't capture CTRL-ALT-DEL without writing your own GINA.

For the Windows or ALT-TAB keys, you can look at these for help:

Capturing Keystrokes without Focus (SO near-duplicate)

How To Set A Windows Hook

Hooks (low-level, but will explain what you need for the P/Invoke)

Erich Mirabal