CTRL ALT DEL

I have an VB6 application running that I do not want the user to be able to shut down or kill the OS using the CTL-ALT-DEL key sequence.  I have tried looking at Windows 95 API calls and returning false to any calling routines to no avail.  Can I intercept this sequence from getting to the OS ? If so, how ?
dipixAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RuchiCommented:
to disable the Ctrl-Alt-Del, put in this code:

Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long

Private Sub Form_Unload(Cancel As Integer)
Call RegisterServiceProcess(0&, 0&)
End Sub

Private Sub Form_Load()
Call RegisterServiceProcess(0&, 1)
End Sub

0
RuchiCommented:
to disable the Ctrl-Alt-Del, put in this code:

Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long

Private Sub Form_Unload(Cancel As Integer)
Call RegisterServiceProcess(0&, 0&)
End Sub

Private Sub Form_Load()
Call RegisterServiceProcess(0&, 1)
End Sub

0
RuchiCommented:
Oops!
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

SpriCommented:
To disable C-A-D entirely add this to your code where appropriate:
(top of mod or frm)
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvparam As Any, ByVal fuWinIni As Long) As Long

X = SystemParametersInfo(97, BOOLEAN, lpvparam, 0)

where BOOLEAN can be true or false


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
headerCommented:
Note:

Spri's answer will turn off Ctrl+Alt+Del AND Alt+Tab until you call the SystemParametersInfo again or the system is rebooted.

The basic idea behind Spri's answer is it fakes the computer into thinking that a screen saver is running.  When a screen saver is running, Windows does not allow Ctrl+Alt+Del or Alt+Tab.

Ruchi's answer simply hides your application from the task list.  So the user can still press Ctrl+Alt+Del, they just can't shut down your application.
0
caraf_gCommented:
Got a suspicion that this will not work in Windows NT
0
ChaseZeroCommented:
Yup these will not work with NT, or Windows2000 as they were disabled (the APIs anyway)

Cos i think ppl at Microsoft got fedup of programmers doing this
0
caraf_gCommented:
Nothing to do with Micro$oft getting fed up.

Windows is (supposed to be) a multi-tasking operating system. What dipix is trying to do is similar to a single workstation taking over the whole mainframe. It is simply not on.
0
dipixAuthor Commented:
Thank you all for your input.  I was able to implement the code and it seems to be working well.  To bad about the limitations on the newer OSs.  The idea for us is to not allow disgruntled employes to purposly shut down our sytem at the application level. This would ideed cause havoc at the various plants where our sytems have been implemented.

Cheers all and cudos to Spri !!

Ron
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.