| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 688 人关注过本帖
标题:关于MSGBOX的标题图标问题
取消只看楼主 加入收藏
linandceline
Rank: 2
等 级:论坛游民
威 望:2
帖 子:88
专家分:47
注 册:2014-12-19
结帖率:78.95%
收藏
 问题点数:0 回复次数:1 
关于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 编辑 ]
2015-01-15 16:53
linandceline
Rank: 2
等 级:论坛游民
威 望:2
帖 子:88
专家分:47
注 册:2014-12-19
收藏
得分:0 
已解决
form里我用了vbSystemModal
改用vbMsgBoxSetForeground即可
2015-01-16 09:09
快速回复:关于MSGBOX的标题图标问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021016 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved