亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? subclass.bas

?? 一個很好的界面編程,,適合初學者學習和開發所用,內容齊全.可做為畢業論文和課程設計所用.
?? BAS
字號:
Attribute VB_Name = "MSubclass"
Option Explicit

' declares:
Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetProp Lib "user32" Alias "GetPropA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function SetProp Lib "user32" Alias "SetPropA" (ByVal hwnd As Long, ByVal lpString As String, ByVal hData As Long) As Long
Private Declare Function RemoveProp Lib "user32" Alias "RemovePropA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private 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
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
    lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)
Private Const GWL_WNDPROC = (-4)

' SubTimer is independent of VBCore, so it hard codes error handling

Public Enum EErrorWindowProc
    eeBaseWindowProc = 13080 ' WindowProc
    eeCantSubclass           ' Can't subclass window
    eeAlreadyAttached        ' Message already handled by another class
    eeInvalidWindow          ' Invalid window
    eeNoExternalWindow       ' Can't modify external window
End Enum

Private m_iCurrentMessage As Long
Private m_iProcOld As Long

Public Property Get CurrentMessage() As Long
   CurrentMessage = m_iCurrentMessage
End Property

Private Sub ErrRaise(e As Long)
    Dim sText As String, sSource As String
    If e > 1000 Then
        sSource = App.EXEName & ".WindowProc"
        Select Case e
        Case eeCantSubclass
            sText = "Can't subclass window"
        Case eeAlreadyAttached
            sText = "Message already handled by another class"
        Case eeInvalidWindow
            sText = "Invalid window"
        Case eeNoExternalWindow
            sText = "Can't modify external window"
        End Select
        Err.Raise e Or vbObjectError, sSource, sText
    Else
        ' Raise standard Visual Basic error
        Err.Raise e, sSource
    End If
End Sub

Sub AttachMessage(iwp As ISubclass, ByVal hwnd As Long, _
                  ByVal iMsg As Long)
    Dim procOld As Long, f As Long, c As Long
    Dim iC As Long, bFail As Boolean
    
    ' Validate window
    If IsWindow(hwnd) = False Then ErrRaise eeInvalidWindow
    If IsWindowLocal(hwnd) = False Then ErrRaise eeNoExternalWindow

    ' Get the message count
    c = GetProp(hwnd, "C" & hwnd)
    If c = 0 Then
        ' Subclass window by installing window procecure
        procOld = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindowProc)
        If procOld = 0 Then ErrRaise eeCantSubclass
        ' Associate old procedure with handle
        f = SetProp(hwnd, hwnd, procOld)
        Debug.Assert f <> 0
        ' Count this message
        c = 1
        f = SetProp(hwnd, "C" & hwnd, c)
    Else
        ' Count this message
        c = c + 1
        f = SetProp(hwnd, "C" & hwnd, c)
    End If
    Debug.Assert f <> 0
    
    ' SPM - in this version I am allowing more than one class to
    ' make a subclass to the same hWnd and Msg.  Why am I doing
    ' this?  Well say the class in question is a control, and it
    ' wants to subclass its container.  In this case, we want
    ' all instances of the control on the form to receive the
    ' form notification message.
    c = GetProp(hwnd, hwnd & "#" & iMsg & "C")
    If (c > 0) Then
        For iC = 1 To c
            If (GetProp(hwnd, hwnd & "#" & iMsg & "#" & iC) = ObjPtr(iwp)) Then
                ErrRaise eeAlreadyAttached
                bFail = True
                Exit For
            End If
        Next iC
    End If
                
    If Not (bFail) Then
        c = c + 1
        ' Increase count for hWnd/Msg:
        f = SetProp(hwnd, hwnd & "#" & iMsg & "C", c)
        Debug.Assert f <> 0
        
        ' Associate object with message at the count:
        f = SetProp(hwnd, hwnd & "#" & iMsg & "#" & c, ObjPtr(iwp))
        Debug.Assert f <> 0
    End If
End Sub

Sub DetachMessage(iwp As ISubclass, ByVal hwnd As Long, _
                  ByVal iMsg As Long)
    Dim procOld As Long, f As Long, c As Long
    Dim iC As Long, iP As Long, lPtr As Long
    
    ' Get the message count
    c = GetProp(hwnd, "C" & hwnd)
    If c = 1 Then
        ' This is the last message, so unsubclass
        procOld = GetProp(hwnd, hwnd)
        Debug.Assert procOld <> 0
        ' Unsubclass by reassigning old window procedure
        Call SetWindowLong(hwnd, GWL_WNDPROC, procOld)
        ' Remove unneeded handle (oldProc)
        RemoveProp hwnd, hwnd
        ' Remove unneeded count
        RemoveProp hwnd, "C" & hwnd
    Else
        ' Uncount this message
        c = GetProp(hwnd, "C" & hwnd)
        c = c - 1
        f = SetProp(hwnd, "C" & hwnd, c)
    End If
    
    ' SPM - in this version I am allowing more than one class to
    ' make a subclass to the same hWnd and Msg.  Why am I doing
    ' this?  Well say the class in question is a control, and it
    ' wants to subclass its container.  In this case, we want
    ' all instances of the control on the form to receive the
    ' form notification message.
    
    ' How many instances attached to this hwnd/msg?
    c = GetProp(hwnd, hwnd & "#" & iMsg & "C")
    If (c > 0) Then
        ' Find this iwp object amongst the items:
        For iC = 1 To c
            If (GetProp(hwnd, hwnd & "#" & iMsg & "#" & iC) = ObjPtr(iwp)) Then
                iP = iC
                Exit For
            End If
        Next iC
    
        If (iP <> 0) Then
             ' Remove this item:
             For iC = iP + 1 To c
                lPtr = GetProp(hwnd, hwnd & "#" & iMsg & "#" & iC)
                SetProp hwnd, hwnd & "#" & iMsg & "#" & (iC - 1), lPtr
             Next iC
        End If
        ' Decrement the count
        RemoveProp hwnd, hwnd & "#" & iMsg & "#" & c
        c = c - 1
        SetProp hwnd, hwnd & "#" & iMsg & "C", c
    
    End If
End Sub

Private Function WindowProc(ByVal hwnd As Long, ByVal iMsg As Long, _
                            ByVal wParam As Long, ByVal lParam As Long) _
                            As Long
    Dim procOld As Long, pSubclass As Long, f As Long
    Dim iwp As ISubclass, iwpT As ISubclass
    Dim iPC As Long, iP As Long, bNoProcess As Long
    Dim bCalled As Boolean
    
    ' Get the old procedure from the window
    procOld = GetProp(hwnd, hwnd)
    Debug.Assert procOld <> 0
    
    ' SPM - in this version I am allowing more than one class to
    ' make a subclass to the same hWnd and Msg.  Why am I doing
    ' this?  Well say the class in question is a control, and it
    ' wants to subclass its container.  In this case, we want
    ' all instances of the control on the form to receive the
    ' form notification message.
    
    ' Get the number of instances for this msg/hwnd:
    bCalled = False
    iPC = GetProp(hwnd, hwnd & "#" & iMsg & "C")
    If (iPC > 0) Then
        ' For each instance attached to this msg/hwnd, call the subclass:
        For iP = 1 To iPC
            bNoProcess = False
            ' Get the object pointer from the message
            pSubclass = GetProp(hwnd, hwnd & "#" & iMsg & "#" & iP)
            If pSubclass = 0 Then
                ' This message not handled, so pass on to old procedure
                WindowProc = CallWindowProc(procOld, hwnd, iMsg, _
                                            wParam, ByVal lParam)
                bNoProcess = True
            End If
            
            If Not (bNoProcess) Then
                ' Turn the pointer into an illegal, uncounted interface
                CopyMemory iwpT, pSubclass, 4
                ' Do NOT hit the End button here! You will crash!
                ' Assign to legal reference
                Set iwp = iwpT
                ' Still do NOT hit the End button here! You will still crash!
                ' Destroy the illegal reference
                CopyMemory iwpT, 0&, 4
                ' OK, hit the End button if you must--you'll probably still crash,
                ' but it will be because of the subclass, not the uncounted reference
                
                ' Store the current message, so the client can check it:
                m_iCurrentMessage = iMsg
                m_iProcOld = procOld
                
                ' Use the interface to call back to the class
                With iwp
                    ' Preprocess (only check this the first time around):
                    If (iP = 1) Then
                        If .MsgResponse = emrPreprocess Then
                           If Not (bCalled) Then
                              WindowProc = CallWindowProc(procOld, hwnd, iMsg, _
                                                        wParam, ByVal lParam)
                              bCalled = True
                           End If
                        End If
                    End If
                    ' Consume (this message is always passed to all control
                    ' instances regardless of whether any single one of them
                    ' requests to consume it):
                    WindowProc = .WindowProc(hwnd, iMsg, wParam, ByVal lParam)
                    ' PostProcess (only check this the last time around):
                    If (iP = iPC) Then
                        If .MsgResponse = emrPostProcess Then
                           If Not (bCalled) Then
                              WindowProc = CallWindowProc(procOld, hwnd, iMsg, _
                                                        wParam, ByVal lParam)
                              bCalled = True
                           End If
                        End If
                    End If
                End With
            End If
        Next iP
    Else
        ' This message not handled, so pass on to old procedure
        WindowProc = CallWindowProc(procOld, hwnd, iMsg, _
                                    wParam, ByVal lParam)
    End If
End Function
Public Function CallOldWindowProc( _
      ByVal hwnd As Long, _
      ByVal iMsg As Long, _
      ByVal wParam As Long, _
      ByVal lParam As Long _
   ) As Long
   CallOldWindowProc = CallWindowProc(m_iProcOld, hwnd, iMsg, wParam, lParam)

End Function

' Cheat! Cut and paste from MWinTool rather than reusing
' file because reusing file would cause many unneeded dependencies
Function IsWindowLocal(ByVal hwnd As Long) As Boolean
    Dim idWnd As Long
    Call GetWindowThreadProcessId(hwnd, idWnd)
    IsWindowLocal = (idWnd = GetCurrentProcessId())
End Function
'



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲精品一区| 精品视频在线免费| 免费在线观看日韩欧美| 亚洲精品中文在线影院| 国产精品第四页| 中文字幕一区二区三区在线不卡| 国产三级三级三级精品8ⅰ区| 久久久噜噜噜久噜久久综合| 国产夜色精品一区二区av| 亚洲在线一区二区三区| 午夜精品福利一区二区蜜股av| 亚洲一区二区三区四区五区中文 | 国产一区二区三区在线观看免费 | 亚洲欧洲三级电影| 日韩不卡一区二区三区 | 最近中文字幕一区二区三区| 日本一区二区不卡视频| 国产精品国产三级国产a| 精品在线播放免费| 成人一道本在线| 91麻豆国产福利精品| 色94色欧美sute亚洲13| 欧美日本一区二区三区| 欧美精品一区二区久久婷婷| 欧美国产精品专区| 国产一区高清在线| 欧美成人bangbros| 国产精品久久久久国产精品日日| 国内精品嫩模私拍在线| 一本久久a久久免费精品不卡| 欧美日韩精品系列| 亚洲国产精品久久艾草纯爱| 国产真实乱偷精品视频免| 日韩欧美黄色影院| 亚洲欧美日韩一区二区三区在线观看| 日韩高清在线观看| 欧美日韩精品电影| 亚洲免费视频成人| 日韩高清一级片| 日本欧美大码aⅴ在线播放| 欧美三级电影精品| 亚洲成av人片在www色猫咪| 激情亚洲综合在线| 亚洲免费观看高清| 日本高清免费不卡视频| 亚洲午夜电影在线观看| 91精品国产乱码久久蜜臀| 久久精品一区蜜桃臀影院| 国产精品伊人色| 欧美丰满少妇xxxxx高潮对白| 国产精品久久久久久久岛一牛影视| 成人午夜碰碰视频| 亚洲日本成人在线观看| 在线观看视频一区二区| 欧美韩国一区二区| 色综合久久综合网97色综合 | 日韩高清在线观看| 精品入口麻豆88视频| 国产最新精品精品你懂的| 欧美激情一区三区| 色综合天天综合网国产成人综合天| 国产精品卡一卡二| 久久久99免费| 亚洲欧洲成人精品av97| 国产精品高清亚洲| 精品一区二区av| 国产91精品在线观看| 久久久一区二区三区| 亚洲色图在线看| 乱一区二区av| 一区二区久久久久| 国产亚洲综合色| 亚洲国产日韩综合久久精品| 成人午夜激情视频| 欧美一区二区播放| 亚洲一区二区美女| 成人妖精视频yjsp地址| 欧美日韩一区二区三区视频| 久久亚洲精品小早川怜子| 欧美私模裸体表演在线观看| 欧美激情一区二区在线| 午夜精品福利视频网站| 久久影视一区二区| 亚洲免费在线视频| 97久久久精品综合88久久| 国产一区日韩二区欧美三区| 一区二区高清免费观看影视大全| 久久久久国产精品麻豆| 日本亚洲一区二区| 久久久亚洲综合| 欧美日韩中文字幕精品| 福利91精品一区二区三区| 日本不卡视频一二三区| 亚洲欧美日韩综合aⅴ视频| 久久久久久久一区| 欧美一区二区在线看| 欧美影院精品一区| 99这里只有精品| 一区在线观看视频| 亚洲精品一区二区三区99| 欧美日韩国产免费| 一本到一区二区三区| 风间由美一区二区av101 | 中文幕一区二区三区久久蜜桃| 成人毛片视频在线观看| 精品一区二区三区在线观看| 午夜精品一区二区三区免费视频| 亚洲欧洲综合另类| 中文在线一区二区| 中文字幕精品—区二区四季| 久久一留热品黄| 久久久五月婷婷| 久久久另类综合| 国产亚洲欧美中文| 国产欧美精品一区aⅴ影院| 91蝌蚪porny| 91视频.com| 一本大道久久a久久精品综合| 97久久精品人人澡人人爽| 日韩欧美国产不卡| 91精品国产高清一区二区三区 | 亚洲国产成人porn| 亚洲成在线观看| 日韩av中文字幕一区二区| 日韩国产一区二| 麻豆国产精品777777在线| 国产精品毛片久久久久久| 中文字幕不卡在线观看| 国产精品二区一区二区aⅴ污介绍| 国产精品久久久99| 亚洲精品视频一区| 一区二区欧美在线观看| 亚洲mv在线观看| 美国精品在线观看| 国产乱码精品一区二区三 | 久久精品二区亚洲w码| 国内精品视频一区二区三区八戒| 国产精品性做久久久久久| 99在线精品一区二区三区| 色婷婷精品大视频在线蜜桃视频| 欧美日韩情趣电影| 日韩精品中午字幕| 国产精品日日摸夜夜摸av| 一区二区三区电影在线播| 午夜精品久久久久久久| 国内精品第一页| 91小视频在线免费看| 欧美日韩成人高清| 久久婷婷综合激情| 亚洲黄色免费电影| 欧美a一区二区| 波多野结衣91| 日韩欧美亚洲国产另类| 中文字幕第一区| 日韩福利电影在线| 成+人+亚洲+综合天堂| 国产成人免费视频网站| 国产露脸91国语对白| 欧美在线free| 久久久久久一二三区| 亚洲日本在线a| 国模冰冰炮一区二区| 欧美中文字幕一区| 香蕉av福利精品导航| 国产suv精品一区二区6| 欧美疯狂做受xxxx富婆| 中文字幕一区二区三区不卡在线| 日韩影院免费视频| 青草av.久久免费一区| 99re8在线精品视频免费播放| 精品国产91乱码一区二区三区| 亚洲欧美激情插 | 三级久久三级久久久| 不卡av在线免费观看| 亚洲精品在线三区| 天天综合网天天综合色| 91在线观看免费视频| 国产日韩欧美精品在线| 免费人成黄页网站在线一区二区| 一本到三区不卡视频| 国产精品免费看片| 国产永久精品大片wwwapp| 91精品婷婷国产综合久久性色| 日韩欧美一区中文| 日本一区二区三级电影在线观看| 日韩精品久久理论片| 欧美午夜精品电影| 亚洲卡通欧美制服中文| 成人福利视频网站| 久久婷婷国产综合精品青草| 另类综合日韩欧美亚洲| 欧美精品18+| 亚洲成人高清在线| 欧洲一区二区三区免费视频| 亚洲品质自拍视频| 色综合天天综合网天天狠天天 | 26uuu亚洲综合色欧美| 男女激情视频一区| 欧美成人综合网站| 黄一区二区三区|