home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmNoSwitch
- BorderStyle = 3 'Fixed Double
- Caption = "No Task Switching"
- ClientHeight = 1170
- ClientLeft = 1800
- ClientTop = 1965
- ClientWidth = 3345
- Height = 1575
- Icon = VBSWITCH.FRX:0000
- Left = 1740
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1170
- ScaleWidth = 3345
- Top = 1620
- Width = 3465
- Begin ccWinHook sbcWinHook
- Left = 270
- Messages = VBSWITCH.FRX:0302
- Monitor = 6 'Systemwide
- Top = 330
- End
- Option Explicit
- ' Copyright
- 1994 by Computer Technologies, Inc. All rights reserved.
- Sub Form_Resize ()
- ' Copyright
- 1994 by Computer Technologies, Inc. All rights reserved.
- ' This line forces the application to remain an icon
- ' no matter what happens.
- If Me.WindowState <> 1 Then Me.WindowState = 1
- End Sub
- Sub sbcWinHook_WndMessage (wnd As Integer, msg As Integer, wp As Integer, lp As Long, nodef As Integer)
- ' Copyright
- 1994 by Computer Technologies, Inc. All rights reserved.
- Static bAltDown As Integer
- Dim bEatMessage As Integer
- bEatMessage = False
- ' Evaluate the type of message. The hook control is setup to
- ' only pass us the four messages listed here and no others.
- Select Case msg
- Case WM_SYSCOMMAND
- If wp = SC_TASKLIST Then bEatMessage = True ' Eat CTRL-ESC
- If wnd = Me.hWnd And wp = IDM_ABOUT Then ' About menu choice clicked
- Call APP_About
- End If
- Case WM_SYSKEYDOWN ' For this msg type wp = keycode
- Select Case wp
- Case KEY_ALT
- bAltDown = True ' Track state of ALT key
- Case KEY_TAB
- If bAltDown = True Then
- bEatMessage = True ' Eat ALT-TAB
- End If
- End Select
- Case WM_SYSKEYUP ' For this msg type wp = keycode
- If wp = KEY_ALT Then bAltDown = False ' Track state of ALT key
- Case WM_LBUTTONDBLCLK
- If wnd = gnDesktopHwnd Then bEatMessage = True ' Double click on desktop
- End Select
- ' This code 'eats' or removes the message from the system.
- If bEatMessage = True Then
- nodef = True
- msg = 0
- End If
- End Sub
-