473,544 Members | 1,939 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 9022
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
2622
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...
3
43945
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
3547
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
15360
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...
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
2121
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
1934
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
8530
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
2995
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
7362
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7368
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...
0
7704
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5291
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...
0
4911
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...
0
3404
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1837
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
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
657
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...

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.