用户登录  |  用户注册
首 页源码下载网络学院最新源码源码排行屏蔽广告
当前位置:新兴网络 > 源码下载 > VB源码 > 控件组件 > VB vbMHWB v1.2.1.6浏览器控件源码_VB WebBrowser加强版控件 > frmWinHooks.frm
loading...复制代码
VERSION 5.00
Object = "{33658027-1004-4E1E-8D35-C9146DF87919}#1.0#0"; "vbMHWB.dll"
Begin VB.Form frmWinHooks 
   Caption         =   "Form1"
   ClientHeight    =   3180
   ClientLeft      =   4995
   ClientTop       =   1950
   ClientWidth     =   3360
   LinkTopic       =   "Form1"
   ScaleHeight     =   3180
   ScaleWidth      =   3360
   Visible         =   0   'False
   Begin VBMHWBLibCtl.vbWB vbWB1 
      Height          =   2895
      Left            =   240
      OleObjectBlob   =   "frmWinHooks.frx":0000
      TabIndex        =   0
      Top             =   120
      Width           =   2895
   End
End
Attribute VB_Name = "frmWinHooks"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Using a hidden window
Private inCode As Long
Private sMsg As String

Private Sub vbWB1_OnWMMessage(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, lReturn As Long, Handled As Boolean)

    ''to prevent processing of this key,
    'Handled = True
    'lReturn = 1

    On Error GoTo vbWB1_OnWMMessage_Error
    If uMsg = m_KEYBOARD_LL Then 'global
        Select Case wParam
            Case WM_KEYDOWN
                frmMain.AddToLog "KEYBOARD_LL WM_KEYDOWN"
            Case WM_KEYUP
                frmMain.AddToLog "KEYBOARD_LL WM_KEYUP"
            Case WM_SYSKEYDOWN
                frmMain.AddToLog "KEYBOARD_LL WM_SYSKEYDOWN"
            Case WM_RBUTTONUP
                frmMain.AddToLog "KEYBOARD_LL WM_RBUTTONUP"
        End Select
        Handled = True
        lReturn = 1
    ElseIf uMsg = m_KEYBOARD Then
        frmMain.AddToLog "KEYBOARD = " & Chr(wParam)
        Handled = True
        lReturn = 0
    ElseIf uMsg = m_MOUSE_LL Then 'global
        Select Case wParam
            Case WM_LBUTTONDOWN
                frmMain.AddToLog "MOUSE_LL WM_LBUTTONDOWN"
            Case WM_LBUTTONUP
                frmMain.AddToLog "MOUSE_LL WM_LBUTTONUP"
            Case WM_RBUTTONDOWN
                frmMain.AddToLog "MOUSE_LL WM_RBUTTONDOWN"
            Case WM_RBUTTONUP
                frmMain.AddToLog "MOUSE_LL WM_RBUTTONUP"
            Case WM_MOUSEWHEEL
                frmMain.AddToLog "MOUSE_LL WM_MOUSEWHEEL"
            'Case WM_MOUSEMOVE
            'Case Else
            '    frmMain.AddToLog "MOUSE_LL"
        End Select
        Handled = True
        lReturn = 0
    ElseIf uMsg = m_MOUSE Then
        Select Case wParam
            Case WM_LBUTTONDOWN
                frmMain.AddToLog "MOUSE WM_LBUTTONDOWN"
            Case WM_LBUTTONUP
                frmMain.AddToLog "MOUSE WM_LBUTTONUP"
            Case WM_RBUTTONDOWN
                frmMain.AddToLog "MOUSE WM_RBUTTONDOWN"
            Case WM_RBUTTONUP
                frmMain.AddToLog "MOUSE WM_RBUTTONUP"
            'like mousemove
            'Case WM_MOUSEFIRST
            '    frmMain.AddToLog "MOUSE WM_MOUSEFIRST"
            Case WM_MOUSELAST
                frmMain.AddToLog "MOUSE WM_MOUSELAST"
            Case WM_MOUSELEAVE
                frmMain.AddToLog "MOUSE WM_MOUSELEAVE"
            Case WM_MOUSEACTIVATE
                frmMain.AddToLog "MOUSE WM_MOUSEACTIVATE"
            Case WM_MOUSEWHEEL
                frmMain.AddToLog "MOUSE WM_MOUSEWHEEL"
            Case WM_NCLBUTTONDOWN
                frmMain.AddToLog "MOUSE WM_NCLBUTTONDOWN"
            Case WM_NCLBUTTONUP
                frmMain.AddToLog "MOUSE WM_NCLBUTTONUP"
            Case WM_NCMOUSELEAVE
                frmMain.AddToLog "MOUSE WM_NCMOUSELEAVE"
            Case WM_NCRBUTTONDOWN
                frmMain.AddToLog "MOUSE WM_NCRBUTTONDOWN"
            Case WM_NCRBUTTONUP
                frmMain.AddToLog "MOUSE WM_NCRBUTTONUP"
        End Select
        Handled = True
        lReturn = 0
    ElseIf uMsg = m_SYSMSGFILTER Then
        frmMain.vbWB1.HookProcNCode WHT_SYSMSGFILTER, inCode
        Select Case inCode
            Case MSGF_DDEMGR
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_DDEMGR"
            Case MSGF_DIALOGBOX
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_DIALOGBOX"
            Case MSGF_MENU
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_MENU"
            Case MSGF_SCROLLBAR
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_SCROLLBAR"
            Case MSGF_MESSAGEBOX
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_MESSAGEBOX"
            Case MSGF_MOVE
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_MOVE"
            Case MSGF_SIZE
                frmMain.AddToLog "WHT_SYSMSGFILTER MSGF_SIZE"
            Case Else
                frmMain.AddToLog "WHT_SYSMSGFILTER"
        End Select
        Handled = True
        lReturn = 0
    ElseIf uMsg = m_MSGFILTER Then
        frmMain.vbWB1.HookProcNCode WHT_MSGFILTER, inCode
        Select Case inCode
            Case MSGF_DDEMGR
                frmMain.AddToLog "WHT_MSGFILTER MSGF_DDEMGR"
            Case MSGF_DIALOGBOX
                frmMain.AddToLog "WHT_MSGFILTER MSGF_DIALOGBOX"
            Case MSGF_MENU
                frmMain.AddToLog "WHT_MSGFILTER MSGF_MENU"
            Case MSGF_SCROLLBAR
                frmMain.AddToLog "WHT_MSGFILTER MSGF_SCROLLBAR"
            Case MSGF_MESSAGEBOX
                frmMain.AddToLog "WHT_MSGFILTER MSGF_MESSAGEBOX"
            Case MSGF_MOVE
                frmMain.AddToLog "WHT_MSGFILTER MSGF_MOVE"
            Case MSGF_SIZE
                frmMain.AddToLog "WHT_MSGFILTER MSGF_SIZE"
            Case Else
                frmMain.AddToLog "WHT_MSGFILTER"
        End Select
        Handled = True
        lReturn = 0
    ElseIf uMsg = m_CBT Then
        frmMain.vbWB1.HookProcNCode WHT_CBT, inCode
        Select Case inCode
            Case HCBT_ACTIVATE
                frmMain.AddToLog "HCBT_ACTIVATE"
            Case HCBT_CLICKSKIPPED
                frmMain.AddToLog "HCBT_CLICKSKIPPED"
            Case HCBT_CREATEWND
                frmMain.AddToLog "HCBT_CREATEWND"
            Case HCBT_DESTROYWND
                frmMain.AddToLog "HCBT_DESTROYWND"
            Case HCBT_KEYSKIPPED
                frmMain.AddToLog "HCBT_KEYSKIPPED"
            Case HCBT_MINMAX
                frmMain.AddToLog "HCBT_MINMAX"
            Case HCBT_MOVESIZE
                frmMain.AddToLog "HCBT_MOVESIZE"
            Case HCBT_QS
                frmMain.AddToLog "HCBT_QS"
            Case HCBT_SETFOCUS
                frmMain.AddToLog "HCBT_SETFOCUS"
            Case HCBT_SYSCOMMAND
                Select Case wParam
                    Case SC_CLOSE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_CLOSE"
                    Case SC_CONTEXTHELP
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_CONTEXTHELP"
                    Case SC_HOTKEY
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_HOTKEY"
                    Case SC_HSCROLL
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_HSCROLL"
                    Case SC_KEYMENU
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_KEYMENU"
                    Case SC_MAXIMIZE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_MAXIMIZE"
                    Case SC_MINIMIZE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_MINIMIZE"
                    Case SC_MONITORPOWER
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_MONITORPOWER"
                    Case SC_MOUSEMENU
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_MOUSEMENU"
                    Case SC_MOVE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_MOVE"
                    Case SC_NEXTWINDOW
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_NEXTWINDOW"
                    Case SC_PREVWINDOW
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_PREVWINDOW"
                    Case SC_RESTORE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_RESTORE"
                    Case SC_SCREENSAVE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_SCREENSAVE"
                    Case SC_SIZE
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_SIZE"
                    Case SC_TASKLIST
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_TASKLIST"
                    Case SC_VSCROLL
                        frmMain.AddToLog "HCBT_SYSCOMMAND SC_VSCROLL"
                    Case Else
                        frmMain.AddToLog "HCBT_SYSCOMMAND  SC_ElSE"
                End Select
            Case Else
                    frmMain.AddToLog "HCBT_ELSE"
        End Select
        Handled = True
        lReturn = 0
    End If

    Exit Sub
vbWB1_OnWMMessage_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure vbWB1_OnWMMessage of Form frmWinHooks"
End Sub