|
-
Sep 27th, 2000, 07:36 AM
#1
Thread Starter
Junior Member
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.
-
Sep 27th, 2000, 07:46 AM
#2
Addicted Member
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
To disable Ctrl-Alt-Delete:
Call DisableCtrlAltDelete(True)
To enable Ctrl-Alt-Delete:
Call DisableCtrlAltDelete(False)
Good luck.
-
Sep 28th, 2000, 03:05 AM
#3
Thread Starter
Junior Member
I hope the code supplied works with your computer?
have you tried the code yourself?
-
Sep 30th, 2000, 08:16 AM
#4
Addicted Member
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.
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
Good Luck.
-
Sep 30th, 2000, 08:21 AM
#5
_______
<?>
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 I updated my code with Lyla's code because it was more slick and still got the job done.
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 11th, 2000, 12:18 AM
#6
New Member
ctrl-alt-del win Nt/2000
Does anybody know how to do it in nt or win2000. The above coed dosent work for me.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|