469,588 Members | 2,688 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,588 developers. It's quick & easy.

Capture Ctrl+Alt+Del

Hi Folks,
Can any of your folks tell me as to how can I capture the keys Ctrl+Alt+Del in C# or Vb.NET.
Jul 21 '05 #1
2 8720
In Win98 you could pretend the screensaver was running, for NT you'll have
to rewrite gina.dll afaik. There is a sample of it on msdn. But I think it
won't be possible in C# or VB.Net.
Actually I never met a circumstance on which not being able to press
CTRL+ALT+DEL is a good case. Not even internet cafes. If it crashes I still
want to be able to terminate it.


"Pradeep M M" <pr*******@hotmail.com> schreef in bericht
news:CA**********************************@microsof t.com...
Hi Folks,
Can any of your folks tell me as to how can I capture the keys Ctrl+Alt+Del in C# or Vb.NET.


Jul 21 '05 #2
Hello Pradeep,

Thanks for your post. As I understand, you want to capture the
Ctrl-Alt-Delete programmatically. Please correct me if there is
any misunderstanding. I'd like to share the following information with you:

To trap Ctrl+Alt+Del, generally speaking, you have three options: write a
GINA stub, write a keyboard driver, or replace TaskMgr.exe with your own
program. Creating a GINA stub is comparatively easy to implement among
these three options.

Yves is correct that we have to use VC instead of C#, VB to implement a
GINA Stub. As you know, a GINA Stub is a native dynamic-link library (DLL)
exported to Winlogon that requires a valid, consistent function to call
into. This requires a DLL export, which .NET Framework does not support.
Managed code (VB .NET, C#) has no concept of a consistent value for a
function pointer because these function pointers are proxies that are built

There is an existing GINA Stub sample in MSDN. To trap Ctrl-Alt-Delete, you
just need to replace its lxLoggedOnSAS with the one in my code snippet

GinaStub Sample: Pass-through "Stub" Gina

/*----------------------------code snippet----------------------*/
PVOID pWlxContext,
DWORD dwSasType,
PVOID pReserved)
/* Add additional code of you own */
return GWlxLoggedOnSAS( pWlxContext, dwSasType, pReserved );
/*-----------------------------end of--------------------------------*/

In addition, I believe the following MSDN aritcles are helpful:

Typename, Disabling Keys in Windows XP with TrapKeys


Loading and Running a GINA DLL

Please feel free to let me know if you have any problems or concerns.


Microsoft Online Partner Support

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Pedro Graca | last post: by
3 posts views Thread by Kevin Bilbee | last post: by
2 posts views Thread by Pradeep M M | last post: by
2 posts views Thread by Mark Callaway | last post: by
3 posts views Thread by ranjithsubra | last post: by
9 posts views Thread by Gillard | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.