关于MSGBOX的标题图标问题
怎么调整上面这张的MSGBOX图标成下面这张
注:我是用了修改MSGBOX的模块,代码是下面的
Option Explicit
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Private Declare Function SetDlgItemText Lib "user32" Alias "SetDlgItemTextA" (ByVal hDlg As Long, ByVal nIDDlgItem As Long, ByVal lpString As String) As Long
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Private Const WH_CBT = 5
Private Const HCBT_ACTIVATE = 5
Private hHook As Long
Private Function HookProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If nCode = HCBT_ACTIVATE Then
Dim hwnd As Long
hwnd = wParam
SetDlgItemText hwnd, vbOK, ByVal "确定"
SetDlgItemText hwnd, vbCancel, ByVal "打开文件"
SetDlgItemText hwnd, vbYes, ByVal "我已知悉"
SetDlgItemText hwnd, vbNo, ByVal "稍后提醒"
SetDlgItemText hwnd, vbAbort, ByVal "放弃"
SetDlgItemText hwnd, vbIgnore, ByVal "忽略"
SetDlgItemText hwnd, vbRetry, ByVal "重试"
UnhookWindowsHookEx hHook
End If
HookProc = 0
End Function
Public Function MsgBox(Prompt As String, Optional Button As VbMsgBoxStyle = vbOKOnly, Optional Title As String) As VbMsgBoxResult
If Len(Title) = 0 Then Title = App.Title
hHook = SetWindowsHookEx(WH_CBT, AddressOf HookProc, App.hInstance, App.ThreadID)
MsgBox = MessageBox(Form1.hwnd, Prompt, Title, Button)
End Function
[ 本帖最后由 linandceline 于 2015-1-15 16:56 编辑 ]