473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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.
Pradeep
Jul 21 '05 #1
2 9001
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.

Yves

"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.

Pradeep

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
dynamically.

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
below.

GinaStub Sample: Pass-through "Stub" Gina
http://msdn.microsoft.com/library/de...us/vcsample98/
html/vcsmpginastubsample.asp?frame=true

/*----------------------------code snippet----------------------*/
int
WINAPI
WlxLoggedOnSAS(
PVOID pWlxContext,
DWORD dwSasType,
PVOID pReserved)
{
if (dwSasType == WLX_SAS_TYPE_CTRL_ALT_DEL)
{
/* Add additional code of you own */
return WLX_SAS_ACTION_NONE;
}
else
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
http://msdn.microsoft.com/msdnmag/is...A/default.aspx

WlxLoggedOnSAS
http://msdn.microsoft.com/library/de...us/security/se
curity/wlxloggedonsas.asp

Loading and Running a GINA DLL
http://msdn.microsoft.com/library/de...us/security/se
curity/loading_and_running_a_gina_dll.asp

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

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

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

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pedro Graca | last post by:
Well ... I've been using Windows for a long time before I switched to Linux. I'm very used to type CTRL-ALT-DEL everytime I'm leaving my computer or arriving to it. It's hapenned _twice_ (in the...
3
by: Stefan | last post by:
Hy, i have an app and i must disable this combination: ALT+F4; CTRL+ALT+DEL; CTRL+ESC;ALT+TAB like this: i find something on Internet and i can block ALT+F4 protected override...
4
by: | last post by:
I want to program a application for user login in windows.Now I has some question about disable the system hotkey(c+a+d,alt+tab,win key.etc.) and limit the mouse cursor in winform How can I do it?...
3
by: Kevin Bilbee | last post by:
I need to know the API call to disable the CTRL-ALT-DEL in a C# windows form. We have created a time clock application to run on a tablet PC to replace the windows shell, we are going to hang it...
2
by: Pradeep M M | last post by:
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. Pradeep
2
by: Mark Callaway | last post by:
Hello I'm trying to make a little windows service which blocks access to some other program, in order to prevent my childrens to play with some of my games. It works perfectly, but the...
3
by: ranjithsubra | last post by:
Hi , i am a new member of this group,Learning vc++, 1.If i press Ctrl+Alt+Del, what happen Desktop window will be shoutdown, logof ,etc. 2. I need to Hide the KeyCombination CTRL+ALT+DEL, when...
10
by: thupham | last post by:
Dear all friend, I want disable Ctl+Alt+Del; Ctrl+Esc; Ctrl+tab, Alt+Tab, Start button, ctrl+Alt+Del, lock all keys on the keyboard. Have you ever do it in C#. Help me. Thanks for all reply.
9
by: Gillard | last post by:
hi all is it possible to block the CTRL+ALT+DEL Key conbinations in a vb.net application?? ans how to ?? please !
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.