📄 apinotifymessageheader.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ApiNotifyMessageHeader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'\\ --[ApiNotifyMessageHeader]--------------------
'\\ Wrapper for the NMHDR structurte passed in the
'\\ lParam of the WM_NOTIFY message
'\\ ----------------------------------------------
Private Type NMHDR
hwndFrom As Long
idFrom As Long
Code As Long
End Type
Public CreatedOK As Boolean
'\\ Private memory handling functions
Private Declare Sub CopyMemoryNMHDR Lib "KERNEL32" Alias "RtlMoveMemory" (Destination As NMHDR, ByVal Source As Long, ByVal Length As Long)
Private Declare Function IsBadReadPtrNMHDR Lib "KERNEL32" Alias "IsBadReadPtr" (ByVal lp As Long, ByVal ucb As Long) As Long
Private Declare Function IsBadWritePtrNMHDR Lib "KERNEL32" Alias "IsBadWritePtr" (ByVal lp As Long, ByVal ucb As Long) As Long
Public hwndFrom As Long
Public idFrom As Long
Public Code As Long
'\\ --[CreateFromPointer]---------------------------------------------
'\\ Fills this NMHDR object from the location poiunted to by
'\\ lpNMHDR
'\\ ----------------------------------------------------------------------------------------
'\\ (c) 2001 - Merrion Computing. All rights to use, reproduce or publish this code reserved
'\\ Please check http://www.merrioncomputing.com for updates.
'\\ ----------------------------------------------------------------------------------------
Friend Function CreateFromPointer(lpNMHDR As Long) As Boolean
Dim ftThis As NMHDR
CreatedOK = False
If Not IsBadReadPtrNMHDR(lpNMHDR, Len(ftThis)) Then
Call CopyMemoryNMHDR(ftThis, lpNMHDR, Len(ftThis))
If Err.LastDllError = 0 Then
With ftThis
Code = .Code
hwndFrom = .hwndFrom
idFrom = .idFrom
CreatedOK = True
End With
Else
ReportError Err.LastDllError, "ApiNotifyMessageHeader:CreateFromPointer", GetLastSystemError
End If
End If
CreateFromPointer = CreatedOK
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -