How can I disable Alt-F4 and Ctrl-Alt-Del by using hooking?

You can't intercept CTRL+ALT+DEL. It's known as the secure attention key and if an app could intercept it then the computer's security would be compromised.

You can't intercept CTRL+ALT+DEL. It's known as the secure attention key and if an app could intercept it then the computer's security would be compromised. What you can do is to configure Windows to ignore Ctrl+Alt+Del by disabling task manager: msdn.microsoft.com/en-us/library/ms81199... There's no reason why you shouldn't be able to intercept ALT+F4 but it's hard to advise you since you haven't been completely clear in your question.In particular the code you present is out of context and I can't guess to which events it runs in response.

If you are looking for the key code for F4 then it is &H73. I strongly recommend you use the standard named constants rather than hard coded literal values, e.g. VbKeyF4.

– e-qi Jun 18 at 11:09 1 Not that I know of, and I'd be very surprised if you could do this. This question is an XY problem. Could you tell us what you are trying to achieve.

– David Heffernan Jun 18 at 11:16 Why is this down voted? Did I make a mistake? – David Heffernan Jun 18 at 15:13.

You cannot disable the ctrl-alt-delete combination because it never reaches the application-level. It is handled by the OS, and OS only! You'd be better off ripping the keys off your keyboard.

Nevertheless, there are ways to bypass this restriction, like writing your own keyboard driver or through a Gina stub.

Gina won't get you anywhere these days, it no longer exists in Vista/7. – David Heffernan Jun 18 at 10:52 @David true, except he didn't specifically say it wasn't for NT But not through the usual hook you're used to. The above methods will work.

– freedompeace Jun 18 at 12:28.

Well, it is true that you cannot capture Ctrl+Alt+Del combination even with global keyboard hooks because it is directly transmitted to OS, but you can easily trick this. I am not sure about your whole problem but I am thinking that you want to disable the Task Manager while your application is running. Steps: Onload event of our application start task manager in hidden mode (Now if user presses Ctrl+Alt+Del nothing will happen).

OnClose Event of your application simply close Task Manager.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions