How do you trap Ctrl+Alt+Del in windows 95, just like we did in old Dos.
I want to prevent the task manager screen from coming up, on pressing the three keys, while my form is on the screen.
Printable View
How do you trap Ctrl+Alt+Del in windows 95, just like we did in old Dos.
I want to prevent the task manager screen from coming up, on pressing the three keys, while my form is on the screen.
To disable Ctrl-Alt-Delete:Code:
Private Declare Function SystemParametersInfo Lib_
"user32" Alias "SystemParametersInfoA" (ByVal uAction_
As Long, ByVal uParam As Long, ByVal lpvParam As Any,_
ByVal fuWinIni As Long) As Long
Sub DisableCtrlAltDelete(bDisabled As Boolean)
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Call DisableCtrlAltDelete(True)
To enable Ctrl-Alt-Delete:
Call DisableCtrlAltDelete(False)
Good luck.
have you tried the code yourself?
Sorry for being late.
Yes I have. This is the way I use it.
Paste the above code in a module.
Paste these 2 calls in your form.
Code:Private Sub Form_Load()
Call DisableCtrlAltDelete(True) ''' To Disable Ctrl+Alt+Del System wide
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call DisableCtrlAltDelete(False) ''' To Enable Ctrl+Alt+Del again
End Sub
Also, If you want To Disable Alt+F4 :
Paste the following in your form.
Good Luck.Code:Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim AltDown
AltDown = (Shift And vbAltMask) > 0 'To Disable Alt+F4
If KeyCode = vbKeyF4 And AltDown Then
KeyCode = 0
MsgBox " Sorry! To exit this App. please press Quit Button"
End If
End Sub
I can verify, the code works.
I was going to paste my method and saw the above and thought that there must be something missing as it was a callor two shorter than what I had been using.
So, I tested it, and it worked like a charm....matter of fact :D I updated my code :D with Lyla's code because it was more slick and still got the job done.
Wayne
Does anybody know how to do it in nt or win2000. The above coed dosent work for me.
Thanks