|
-
January 25th, 2001, 07:31 AM
#1
ALT+CTL+DEL
HOW CAN I TRAP ALT+CTL+DEL?
THANKS IN ADVANCE
-
January 25th, 2001, 08:02 AM
#2
Re: ALT+CTL+DEL
Use the Keycode function in the Keydown event and if the Control key is pressed then Keycode = 0 and
exit the subroutine. See the VB help file on Keycode.
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Dim ShiftDown, AltDown, CtrlDown, Txt
Const KEY_F2 = &H71 ' Define constants.
Const SHIFT_MASK = 1
Const CTRL_MASK = 2
Const ALT_MASK = 4
ShiftDown = (Shift And SHIFT_MASK) > 0
AltDown = (Shift And ALT_MASK) > 0
CtrlDown = (Shift And CTRL_MASK) > 0
If CtrlDown Then
'MsgBox "Control key pressed"
KeyCode = 0
End If
End sub
'This is how you can trap that the key is pressed. If you want to know how to disable it let me know
Iouri Boutchkine
[email protected]
-
January 25th, 2001, 09:03 AM
#3
Re: ALT+CTL+DEL
thanks for the reply.yes i want to know how to disable it.i do not want the system to do what it actually does when this combination is pressed.
-
January 25th, 2001, 09:07 AM
#4
Re: ALT+CTL+DEL
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (byval _
uAction as Long, byval uParam as Long, byref lpvParam as Any, byval fuWinIni as Long) as Long
private Const SPI_SCREENSAVERRUNNING = 97
private Sub Form_Load()
'Disable HotKeys, including. CTRL+ALT+DEL and ALT+TAB
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, byval 0&, 0&)
End Sub
'ReEnable HotKeys
private Sub Form_Unload(Cancel as Integer)
Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, byval 0&, 0&)
End Sub
'====disable only Ctrl-Alt-Del========
Sub DisableCtrlAltDelete(bDisabled As Boolean)
Dim X As Long
X = SystemParametersInfo(SPI_SCREENSAVERRUNNING, bDisabled, CStr(1), 0)
End Sub
Iouri Boutchkine
[email protected]
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
|