一聚教程网:一个值得你收藏的教程网站

热门教程

在MapX中响应滚轮放大缩小地图

时间:2022-07-02 11:12:57 编辑:袖梨 来源:一聚教程网

’模块中
Option Explicit
Public Const GWL_WNDPROC = (-4)
Public Const WM_COMMAND = &H111
Public Const WM_MBUTTONDOWN = &H207
Public Const WM_MBUTTONUP = &H208
Public Const WM_MOUSEWHEEL = &H20A
Public Oldwinproc     As Long
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 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
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Function FlexScroll(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
      Select Case wMsg
     Case WM_MOUSEWHEEL
         Select Case wParam
             Case -7864320     '向下滚
            SetCurrentScale "ZoomOut", 2
             Case 7864320         '向上滚
            SetCurrentScale "ZoomIn", 2
     End Select

热门栏目