Quote:
>I have a front end written in Visual Basic 3 Professional interface on to
>an Access 2 database. I want to prevent users tabbing out of this VB
>application by using Alt Tab. It would also be nice to be able to disable
>Ctrl Alt Delete.
>Can anybody advise me on how to implement this, please?
>Peter Dawson
This is a piece of code I used when I wrote a Screensaver in VB4.0 :-
Private Sub Form_KeyDown(Keycode As Integer, Shift As Integer)
Dim Handle As Integer
Dim ShiftDown, AltDown, CtrlDown
Const SHIFT_MASK = 1
Const CTRL_MASK = 2
Const ALT_MASK = 4
ShiftDown = (Shift And SHIFT_MASK) > 0
CtrlDown = (Shift And CTRL_MASK) > 0
AltDown = (Shift And ALT_MASK) > 0
If ShiftDown Or CtrlDown Or AltDown Then
Put whatever code you need in here
End If
End Sub
I used it to trap the ALT key to stop users from ALT & TABbing past my
Screensaver onto other programs, but it traps SHIFT and CTRL as well.
Hope this is of some use !
Woodster