Код:
- Код: Выделить всё
Sub CallMsg()
Dim lpIDList As Long
Dim udtBI As BrowseInfo
With udtBI
.hWndOwner = Form1.hwnd
.lpfnCallback = GetAddressOfFunction(AddressOf MsgCallBack)
End With
SHBrowseForFolder udtBI
Dim MBP As MSGBOXPARAMS
With MBP
.cbSize = Len(MBP)
.hWndOwner = Form1.hwnd
.lpszText = "text"
.lpszCaption = "other text"
.dwStyle = MB_ICONINFORMATION
.lpfnMsgBoxCallback = GetAddressOfFunction(AddressOf MsgCallBack)
End With
MessageBoxIndirect MBP
End Sub
Public Function GetAddressOfFunction(add As Long) As Long
GetAddressOfFunction = add
End Function
Public Function MsgCallBack(ByVal hwnd As Long, ByVal uMsg As Long, ByVal lp As Long, ByVal pData As Long) As Long
On Error Resume Next
Debug.Print "CallBack Successed " & hwnd & Chr(32) & uMsg
MsgCallBack = 0
End Function