zoukankan      html  css  js  c++  java
  • 设置快捷键的方式

    Declare Function CallWindowProc Lib "USER32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

    Public Declare Function RegisterHotKey Lib "USER32" (ByVal hWnd As Long, ByVal ID As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
    Public Declare Function UnregisterHotKey Lib "USER32" (ByVal hWnd As Long, ByVal ID As Long) As Long
    Public Const WM_HOTKEY = &H312

    Public Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" _
    (ByVal hWnd As Long, _
    ByVal nIndex As Long, _
    ByVal dwNewLong As Long) As Long
    Public Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" _
    (ByVal hWnd As Long, _
    ByVal nIndex As Long) As Long

    Dim dt As Long
    dt = RegisterHotKey(Me.hWnd, 10001, 0, vbKeyS)
    dt = RegisterHotKey(Me.hWnd, 10002, 0, vbKeyC)
    dt = RegisterHotKey(Me.hWnd, 10003, 0, vbKeyK)


    prevWndProc = GetWindowLong(Me.hWnd, GWL_WNDPROC)
    SetWindowLong Me.hWnd, GWL_WNDPROC, AddressOf WndProcB

    Function WndProcB(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    If Msg = WM_HOTKEY Then
    frmCali.keypress lParam
    End If
    WndProcB = CallWindowProc(prevWndProc, hWnd, Msg, wParam, lParam)
    End Function

  • 相关阅读:
    【git】之常用命令
    VueJs
    如何做技术选型
    用户登录验证注意事项
    npm xss
    express-session
    ejs、jade和dust
    XMLHttpRequest.responseType
    JS对象字面量
    安装Angulr CLI
  • 原文地址:https://www.cnblogs.com/rosesmall/p/3155949.html
Copyright © 2011-2022 走看看