用的Hook_API这个函数
Dim Shared PMessageBox As Function(ByVal hWnd As hWnd ,ByVal lpText As ZString Ptr ,ByVal lpCaption As ZString Ptr ,ByVal uType As ULong) As Long
------------------------
'替换函数
Function oMessageBox(ByVal hWnd As hWnd ,ByVal lpText As ZString Ptr ,ByVal lpCaption As ZString Ptr ,ByVal uType As ULong) As Long
Static ret As Long
ret = PMessageBox(hWnd ,lpText ,lpCaption ,uType)
Function = ret
End Function
-------------------------
'hook MessageBoxA
Dim addr As Any Ptr = Hook_API("user32" ,"MessageBoxA" ,@oMessageBox)
If addr Then PMessageBox = addr