Question

Interrupt Handler for 0x19 (Ctrl+Alt+Del) in VB6

Asked by: codeconqueror

I want to implement an interrupt handler for interrupt 0x19 to catch Ctrl+Alt+Del.  I believe Ctrl+Alt+Del generates an interrupt 0x19, which is not routed as a keyboard message.  Can anyone come up with some sample code on how I might be able to intercept and block that message?  I have tried to use hooks but since it doesn't generate a normal keyboard message, these efforts have been in vain.  I have already disabled all the buttons on the Ctrl+Alt+Del screen, but now I want to disable bringing up the screen altogether.  I know most people believe it isn't possible to do this, but there is a product that I can purchase to do it, but it costs $300 (http://www.meliorasoft.com/kits/keyboard/), so I know there must be a way.  Any help would be GREATLY appreciated.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-06-02 at 09:27:44ID21444794
Tags

alt

,

ctrl

,

del

,

vb6

,

interrupt

Topic

Visual Basic Programming

Participating Experts
7
Points
500
Comments
34

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Dos interrupts
    I am on an NT 4SP3 computer and I am writing a console app. I am porting this app from UNIX. My unix program catches interrupts. How do I catch interrupts for a comand Prompt app? What are the interrupts that get sent to the system for a "Ctrl-C", closing the wi...
  2. Interrupts
    I need someone to list down all the hardware interrupts 1) which interrupts are used? normally by what? 2) which interrupts are free for use (e.g sound card, network card, etc) I am using a Intel Pentium III system.
  3. Signals and Interrupts
    What is the difference between a signal and an interrupt?
  4. --Change an Interrupt Vector--
    Hi! 1- How To Change An Interrupt Vector?(Example: Change INT 10,04 Vector To My Routine) 2- If I Change an Interrupt Vector, Changing Will Remain On The BIOS? Please Give Me an Example For Q-1. I'm Using Tasm. Bye Programmer-x
  5. Intercept keyboard input.
    I want to intercept keyboard input using hooks, so that i can make the keyboard perform multiple functions on a keypress. for example, if i press the key "+" then it should be automatically followed by 3 times keypress of key "*". can any body explain me ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Arthur_WoodPosted on 2005-06-02 at 09:34:45ID: 14132312

as far as I am aware, it is not possible to write an interupt handler in VB6.  and the product you refer to was probably written in either ASSEMBLER, or at the very least possibly C but certainly NOT VB.

Interupt handlers operate MUCH TOO close to the operating syste/hardware.

AW

 

by: codeconquerorPosted on 2005-06-02 at 09:39:00ID: 14132354

Okay, well I'd be willing to write a library that I can implement from VB (i.e. a C DLL that I can call from VB 6) in another language.  Any ideas on how I could do that (sample code)?  Thanks.

 

by: vinnyd79Posted on 2005-06-02 at 09:40:55ID: 14132389

 

by: cjardPosted on 2005-06-02 at 09:41:30ID: 14132395

try this:

Dim pay as Integer
pay = CInt(InputBox("How much are you paid in (money units) per hour?"))

Dim days as Integer
days = CInt(InputBox("Approximately how many days of coding, testing do you think it would take to rewrite the keyboard driver at the HAL layer in windows, install it and have it produce custom messages for the 0h19 interrupt?")) * 2

If pay * days * 24 > 300 then MsgBox "It would be more cost effective to just buy the meliorasoft.com product"

 

by: codeconquerorPosted on 2005-06-02 at 09:50:11ID: 14132483

Ha ha.  Come on, not trying to a d*ck, but give me something useful or nothing at all cjard.  :)  
I'm not spending days and days on this, I've looked into, can't do it, this method shows some promise and if someone can help me get it done quickly, great, if not, obviously I'll have to break down and buy the component.

Vinnyd79, thanks for posting something useful and trying to help.  I'm checking that out and will post back.  :)

 

by: codeconquerorPosted on 2005-06-02 at 09:59:10ID: 14132560

Well, replacing the MSGINA.DLL seems a little involved.  I'll keep looking into since some places offer replacements with source code, but you or anyone else have any other ideas?

 

by: BenClarkPosted on 2005-06-02 at 10:22:51ID: 14132775

I found this a while back.
Remember to put it all back when your application ends.

There is an undocumented way to disable the Ctrl Alt Del key sequence on Windows NT/2000/XP using the registry.

The key, 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon : AutoAdminLogon (REG_SZ)' has only two legal values, according to Microsoft: "0" and "1". 0 disables automatic logon of the account stored, and 1 enables it. The strange thing is that if you set the key to "2", it will enable automatic logon AND disable CTRL + ALT + DEL sequence registration by windows on boot, effectively disabling Task Manager, etc... Of course for this to work you will have to set the "DefaultUserName" and "DefaultPassword" keys to the username to automatically logon.

I've found this the easiest way to kill the Ctrl-Alt-Del sequence.

Again, here are the keys needed to be set:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon : AutoAdminLogon = "2"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon : DefaultUserName = "(the username to automatically logon)"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon : DefaultPassword = "(password for default username)"

 

by: BenClarkPosted on 2005-06-02 at 10:25:28ID: 14132800

Found this one also buried in some of my old code.

Public Declare Function SystemParametersInfo2 Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
    Public Const SPI_SCREENSAVERRUNNING = 97

Public Sub CtrlAltDel_Disable()
    Dim syssend As Long
    syssend& = SystemParametersInfo2(SPI_SCREENSAVERRUNNING, True, False, 0)
End Sub


Public Sub CtrlAltDel_Enable()
    Dim syssend As Long
    syssend& = SystemParametersInfo2(SPI_SCREENSAVERRUNNING, False, True, 0)
End Sub

 

by: codeconquerorPosted on 2005-06-02 at 10:25:50ID: 14132804

BenClark, I'm going to test this out right now.  Will post back in a bit.  If this works the way I want it to I will be SOOOOO happy!!!  Thanks.

 

by: codeconquerorPosted on 2005-06-02 at 10:27:05ID: 14132814

That last one will only work for Windows 98.  I've got that one in my code in case their running 98, but I'm looking to disable it fro 2000/XP.  I will try the registry keys you pointed to and post back in a bit.

 

by: codeconquerorPosted on 2005-06-02 at 10:30:00ID: 14132851

:(  Unfortunately the registry keys won't work.  I was hoping I could edit the keys, put in the current user's information, set the value to 2, run GPUPDATE /Force like I do for a lot of the other Windows rights (i.e. Shutdown) but that doesn't work for those keys.  Thanks anyways.  Any other ideas?

 

by: codeconquerorPosted on 2005-06-02 at 10:34:15ID: 14132889

My software has user rights that an admin can define.  So when the user logs into my software, it applies the Windows rights assigned by the admin for that user (edit the registry, then run GPUPDATE /FORCE, reset registry upon exiting of application or on error).  This way I can say that user A cannot access the desktop and cannot shutdown the pc while user B can while running my program.  So in this case, I need to say that user A cannot press Ctrl+Alt+Del.  The logins are handled by my application, not through Windows.  I think coming up with a library (in any language) that can intercept interrupt 0x19 and can be called somehow from my VB6 app is the only way.  Any one else have any ideas?

 

by: BenClarkPosted on 2005-06-02 at 10:36:37ID: 14132917

I just did a little research.
It seems that in 2K and XP, the ONLY way to trap the Ctrl+Alt+Del is by
writing a new GINA.DLL.

I written one before. There not that hard.
However, you can't write one in VB.

 

by: codeconquerorPosted on 2005-06-02 at 10:38:33ID: 14132932

I know you can write one in C, I was looking a pGina (http://pgina.xpasystems.com/) but am still waiting on an answer from them if that library will be suitable to do what I want to do in the way I want to do it.  Thanks to all so far.

 

by: BenClarkPosted on 2005-06-02 at 10:40:36ID: 14132949

If you can give me a little more detail on what you need it to do,
AND you don't mind waiting a few days, I can make a GINA.DLL for you.

No Charge.
Other than points here. :-)

 

by: codeconquerorPosted on 2005-06-02 at 10:55:04ID: 14133064

BenClark, if you can do that for me I would be eternally grateful and give you as many points as EE will allow!  :)

Here's the detailed spec of what I'm looking to do:

I have a program that has it's own user login functionality.  The user logs into Windows, then runs my program.  When they log into my program, I assign various Windows rights to that user.  So, an Admin logs in and sets up UserA.  UserA has rights X, Y, and Z in my program and is not allowed to shutdown the pc and is not allowed to press Ctrl+Alt+Del.  Now, when UserA logs in, it backs up the current registry entries, edits the registry (or other necessary functions) to block access to the Shutdown option and the Ctrl+Alt+Del option, then runs GPUPDATE /FORCE to apply those new settings from the registry.  This works great.  However, for 2000/XP I cannot disable the pressing of Ctrl+Alt+Del.  So I need a GINA.DLL file that I can disable/enable pressing of Ctrl+Alt+Del on the fly.  I also need to be able to install the new GINA.DLL file as part of my program's installation (I'm using Wise For Windows Installer - latest version) without screwing up anything that they might already be doing with their network logins (some might be running Novell, some might be using a domain, some might just be single stations, or simple peer-to-peer).

Thanks for your help thus far!  :->

 

by: egl1044Posted on 2005-06-02 at 11:01:39ID: 14133131

The easiest way to disable CTRL + ALT + DELETE is to just open the taskmgr!!

Private Sub Command1_Click()
'Enable CTRL ALT DELETE
Close #1
End Sub

Private Sub Form_Load()
'Disable CTRL ALT DELETE
Open "c:\windows\system32\taskmgr.exe" For Binary As #1
End Sub

 

by: egl1044Posted on 2005-06-02 at 11:10:04ID: 14133207

lalalalalala PERFECTION

 

by: vinnyd79Posted on 2005-06-02 at 11:10:35ID: 14133212

That will only disable task Manager, not CTRL + ALT + DEL.

 

by: codeconquerorPosted on 2005-06-02 at 11:12:06ID: 14133225

I just tried that egl1044, but I can still Ctrl+Alt+Del.  Any other ideas?

 

by: egl1044Posted on 2005-06-02 at 11:17:08ID: 14133271

what else does ctrl alt delete do? I thought it brings up taskmgr

 

by: BenClarkPosted on 2005-06-02 at 11:22:45ID: 14133320

CodeConqueror,
Would you send me an emal at <email removed by sirbounty>?
I will send you some sample code for your GINA.DLL along with some explanations.

 

by: codeconquerorPosted on 2005-06-02 at 11:29:26ID: 14133366

egl1044, that's only in Windows 98.  In NT/2000/XP it brings up a screen allowing you to:  Lock the Workstation, Logoff, Shutdown, Change Password, Task Manager, or Cancel.

BenClark, I'm emailing you right now.  Thanks.  :)

 

by: codeconquerorPosted on 2005-06-02 at 11:36:14ID: 14133434

BenClark, is this something you'll definitely be able to do?  It will be able to turn the Ctrl+Alt+Del function on/off on demand?  If so, I'll give you the points and close the question.  Thanks.  In the meantime, if anyone else has any ideas, by all means, speak up.  :)

 

by: BenClarkPosted on 2005-06-02 at 11:41:32ID: 14133474

CodeConquerer,

I just emailed you some source code to take a look at.
I can defenitely do this. No problem. Like I said it is really easy.

The only catch is I can't work on it at work. I don't have the tools here
and they won't let me install them.
I do have my laptop so I can work on it during lunch.
I can defenitly work on it when I get home.
It may take a couple of days to get you up and running.

 

by: BurbblePosted on 2005-06-02 at 12:07:50ID: 14133704

For future reference to users who may want to accomplish a similar task, could you perhaps post the DLL code here ?

Thanks :)

 

by: codeconquerorPosted on 2005-06-02 at 12:09:04ID: 14133718

As soon as I have this ironed out and have a definite usable solution I will make sure to post the exact instructions on what to do and how here.  Thanks to everyone for all your help.  I know that if we can figure this out it will help a lot of people out there.  I've run across countless posts from various places with people looking to do exactly this with no solution.

 

by: codeconquerorPosted on 2005-06-02 at 12:10:22ID: 14133731

I think that BenClark so far has the best idea and we are trying to work out the proper code for the modified GINA.DLL file.  I am still interested in trying to intercept Interrupt 0x19 though, so if anyone has any ideas in that direction please let me know.

 

by: codeconquerorPosted on 2005-06-02 at 12:11:35ID: 14133743

Also, the way that meliorasoft is doing it is with a keyboard driver, so if anyone knows (or has) a keyboard driver that can be modified to not report the Ctrl+Alt+Del sequence, that would be of great interest as well.

 

by: codeconquerorPosted on 2005-06-02 at 14:00:03ID: 14134694

There is a program from http://www.phord.com/keyblock.html which does exactly what I want, but it's a program you run, and I'm not sure if its something you can integrate with.  But he is blocking the keys on the fly with no problems.  I wan't to know what he's doing, but he's not going to tell me and make it unnessary for me to buy his software.  Grrr, it's so frustrating to know it can be done, I just don't know how.  :(

 

by: codeconquerorPosted on 2005-06-02 at 14:58:34ID: 14135141

FINALLY!!! I'VE GOT IT!!!! YAY YAY.  The following link will let you download a free dll and example and source code to disable it on the fly.  Here you go everyone, enjoy!!

http://www.codeproject.com/win32/AntonioWinLock.asp

Once you have the DLL in your project's path or in WIndows\System32, just call it using:

<CODE SNIPPET>
Private Declare Function CtrlAltDel_Enable_Disable Lib "WinLockDll.dll" (ByVal bEnableDisable As Boolean) As Integer

Private Sub Command1_Click()
CtrlAltDel_Enable_Disable False '**** Disable use of Ctrl+Alt+Del
End Sub

Private Sub Command2_Click()
CtrlAltDel_Enable_Disable True '**** Enable use of Ctrl+Alt+Del
End Sub
</CODE SNIPPET>

 

by: gmbrammerPosted on 2009-11-05 at 16:09:28ID: 25755540

The URL gives me a 404.  Does some have copy of the content provided in the link?

Thanks

 

by: Arthur_WoodPosted on 2009-11-05 at 20:16:42ID: 25756579

the correct url is:

http://www.codeproject.com/win32/AntonioWinLock.aspx

It's an ASP.NET page, not an old ASP page

AW

 

by: Arthur_WoodPosted on 2009-11-05 at 20:17:49ID: 25756583

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...