473,763 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9068
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*******@hotm ail.com> schreef in bericht
news:CA******** *************** ***********@mic rosoft.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 programmaticall y. Please correct me if there is
any misunderstandin g. 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/vcsmpginastubsa mple.asp?frame= true

/*----------------------------code snippet----------------------*/
int
WINAPI
WlxLoggedOnSAS(
PVOID pWlxContext,
DWORD dwSasType,
PVOID pReserved)
{
if (dwSasType == WLX_SAS_TYPE_CT RL_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_run ning_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
2637
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 last six months or so) for my Linux box. I want to be able to reboot my machine with CTRL-ALT-DEL, but I don't want to do it by mistake. So, I noticed /etc/inittab has these lines
3
44027
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 System.Boolean ProcessCmdKey(ref System.Windows.Forms.Message msg,System.Windows.Forms.Keys keyData)
4
3587
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? thanks!
3
15367
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 on a wall for associates to clock in and out and check their benefits. I will disable task manager from Domain Policies but I need to disable the CTRL-ALT-DEL and also be able to renable it from a special passworded menu for administrative...
2
532
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
2135
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 weakest point, is that they can kill my service by using the task manager. That's why i would like to disable ctrl+alt+del.
3
1939
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 i press the this Combination ,nothing going to be happen. Regs Ranjith Kumar.S
10
8584
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
3000
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
10145
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.