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

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

?? subclass.bas

?? 漂亮的VB程序窗體漂亮的VB程序窗體漂亮的VB程序窗體
?? 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一区二区三区免费野_久草精品视频
琪琪一区二区三区| 亚洲综合激情另类小说区| 欧美一区二区视频在线观看2022| 不卡一区二区中文字幕| 国产激情一区二区三区四区 | 国产日韩欧美a| 亚洲精品一区二区三区福利| 精品国产伦一区二区三区观看方式| 欧美一区二区三区电影| 日韩午夜在线观看视频| 精品成人一区二区| 中文字幕第一区二区| 亚洲欧美在线视频观看| 亚洲精品少妇30p| 亚洲444eee在线观看| 蜜臀久久99精品久久久久久9| 免费在线看成人av| 国产91丝袜在线播放九色| 99精品久久免费看蜜臀剧情介绍 | 亚洲香蕉伊在人在线观| 午夜精品国产更新| 久久精品99久久久| 成人18视频在线播放| 欧美三日本三级三级在线播放| 欧美日韩视频第一区| 精品区一区二区| 国产精品国产三级国产有无不卡| 亚洲免费av高清| 日韩精品一级中文字幕精品视频免费观看| 三级一区在线视频先锋| 国产一区二区成人久久免费影院| 99在线精品观看| 日韩三区在线观看| 亚洲人快播电影网| 琪琪久久久久日韩精品| 99在线精品一区二区三区| 制服丝袜av成人在线看| 国产精品妹子av| 日本欧美一区二区在线观看| 国产iv一区二区三区| 欧美精品一卡二卡| 日本一区二区三区电影| 五月天丁香久久| 成人v精品蜜桃久久一区| 在线成人免费视频| 国产精品美日韩| 国产真实精品久久二三区| 色94色欧美sute亚洲线路一久| 日韩欧美在线一区二区三区| 一区二区三区免费看视频| 国产伦理精品不卡| 欧美一级黄色录像| 亚洲成av人片一区二区梦乃| 成人av午夜影院| 国产婷婷色一区二区三区在线| 婷婷开心久久网| 欧美性大战久久久| 18欧美乱大交hd1984| 国产成人福利片| 精品久久一二三区| 蜜桃精品在线观看| 91精品国产入口| 日产国产欧美视频一区精品| 欧美中文一区二区三区| 亚洲欧洲99久久| 成人在线一区二区三区| 久久精品夜色噜噜亚洲a∨| 精品在线播放免费| 欧美成人免费网站| 狠狠色丁香婷婷综合久久片| 在线播放日韩导航| 亚洲成人tv网| 欧美精品成人一区二区三区四区| 亚洲一区二区3| 欧美在线免费视屏| 一区二区三区小说| 欧美性xxxxx极品少妇| 亚洲妇女屁股眼交7| 欧美精品少妇一区二区三区| 日韩1区2区日韩1区2区| 日韩精品一区二区三区老鸭窝 | 国产精品乱子久久久久| 成人午夜私人影院| 国产精品久久久久aaaa| 91精品欧美一区二区三区综合在 | 欧美mv和日韩mv的网站| 国内外成人在线| 国产蜜臀av在线一区二区三区| 国产福利91精品| 国产精品电影院| 欧美在线看片a免费观看| 日韩激情视频在线观看| 欧美成人一区二区三区在线观看| 九一九一国产精品| 国产精品女同互慰在线看| 97精品国产露脸对白| 亚洲v日本v欧美v久久精品| 91精品国产综合久久久久久久久久 | 国产主播一区二区三区| 中文字幕乱码久久午夜不卡| 色综合天天狠狠| 免费成人av资源网| 欧美国产日韩亚洲一区| 欧美日韩不卡一区二区| 激情综合色丁香一区二区| 中文字幕在线观看不卡| 在线成人午夜影院| 成人自拍视频在线| 日韩激情中文字幕| 国产精品久久久久久久久免费桃花| 欧美性色aⅴ视频一区日韩精品| 精品一区二区在线视频| 亚洲免费观看高清完整版在线观看| 欧美蜜桃一区二区三区| 成人av免费在线观看| 免费观看日韩电影| 亚洲精品久久久蜜桃| 久久综合999| 欧美另类videos死尸| 成人国产精品免费| 极品少妇一区二区| 亚洲福中文字幕伊人影院| 亚洲国产高清aⅴ视频| 日韩一区二区精品葵司在线| 91精品国产综合久久香蕉的特点 | 国产成人精品亚洲777人妖| 亚洲一区二区av在线| 国产精品理论片| 亚洲精品在线观看网站| 欧美日韩在线播放三区| 成人午夜激情片| 国内精品伊人久久久久av一坑 | 国产精品久久久久精k8| 日韩精品一区二区三区蜜臀| 色综合色综合色综合| 成人午夜在线播放| 国内精品伊人久久久久av影院| 香蕉成人伊视频在线观看| 综合激情网...| 中文字幕va一区二区三区| 精品免费视频.| 日韩视频免费观看高清在线视频| 欧美日韩一区二区三区四区五区| 成人福利视频在线看| 成人三级在线视频| 成人午夜av影视| 99久久精品国产网站| 成人免费观看视频| 成人短视频下载| 99视频精品在线| 91麻豆免费在线观看| 成人app软件下载大全免费| 成人h动漫精品| 成人三级伦理片| 色综合久久综合网97色综合| 色94色欧美sute亚洲13| 欧美色网一区二区| 国产喷白浆一区二区三区| 国产日韩欧美在线一区| 国产精品三级视频| 国产精品美女久久久久久久| 国产精品不卡一区| 亚洲女与黑人做爰| 亚洲大片精品永久免费| 奇米一区二区三区| 国产一区二区三区日韩| 成人毛片老司机大片| 色综合视频在线观看| 3d成人h动漫网站入口| 欧美电影免费观看完整版| 久久精品视频免费| 亚洲精品高清在线观看| 午夜视频在线观看一区二区三区| 日韩电影在线免费观看| 国产综合色视频| 99视频有精品| 欧美一级免费观看| 国产调教视频一区| 亚洲成人高清在线| 国产一区二区三区久久悠悠色av| 不卡在线视频中文字幕| 欧美精品第1页| 国产欧美日韩激情| 亚洲一区二区精品3399| 国产久卡久卡久卡久卡视频精品| 99精品视频在线播放观看| 日韩一区二区三区在线| 国产精品久久久久久久浪潮网站| 亚洲成人午夜影院| av在线综合网| 精品国产一二三| 亚洲一区二区三区小说| 国产原创一区二区| 日本精品一区二区三区四区的功能| 日韩欧美国产电影| 亚洲国产wwwccc36天堂| 欧美日韩视频在线第一区| 亚洲国产精品国自产拍av| 日本午夜一区二区| 在线视频你懂得一区|