By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

Capture Ctrl+Alt+Del

P: n/a
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
Share this Question
Share on Google+
2 Replies

P: n/a
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*******> schreef in bericht
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

P: n/a
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! --
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.