chrisjk
Nov 28th, 1999, 08:29 AM
Hi everyone. How are we all today?
I have this form that I want the user to deal with before they can do anything with Windows (it traps the mouse to the form and I'm trying to get it to trap keyboard shortcuts). They have to supply a password to "unlock" the mouse/keyboard.
I'm using this code to stop them using keyboard shortcuts, it all works except the ALT+TAB one.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
ShiftDown = (Shift And vbShiftMask) > 0
CtrlDown = (Shift And vbCtrlMask) > 0
Altdown = (Shift And vbAltMask > 0)
If CtrlDown And KeyCode = vbKeyEscape Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyTab Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF6 Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF4 Then
KeyCode = 0
End If
End Sub
Can anyone spot anything wrong? I can't! Is Windows cheaky and not allow you to stop the use of ALT+TAB?
Whilst I'm here, are there any other keyboard shortcuts that I haven't coded for?
Many thanks to all (esp. those who assist :))
Regards,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
I have this form that I want the user to deal with before they can do anything with Windows (it traps the mouse to the form and I'm trying to get it to trap keyboard shortcuts). They have to supply a password to "unlock" the mouse/keyboard.
I'm using this code to stop them using keyboard shortcuts, it all works except the ALT+TAB one.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
ShiftDown = (Shift And vbShiftMask) > 0
CtrlDown = (Shift And vbCtrlMask) > 0
Altdown = (Shift And vbAltMask > 0)
If CtrlDown And KeyCode = vbKeyEscape Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyTab Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF6 Then
KeyCode = 0
ElseIf Altdown And KeyCode = vbKeyF4 Then
KeyCode = 0
End If
End Sub
Can anyone spot anything wrong? I can't! Is Windows cheaky and not allow you to stop the use of ALT+TAB?
Whilst I'm here, are there any other keyboard shortcuts that I haven't coded for?
Many thanks to all (esp. those who assist :))
Regards,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)