把messagebox中的按钮改成中文

shegood1985 2010-09-10 09:29:40
RT,好像很困难,不过如果有哪位大哥有现成的类的话麻烦给一个
...全文
809 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
shegood1985 2010-09-13
  • 打赏
  • 举报
回复
谢谢各位,上面的方法必须有语言包才行,最后还是在codeproject上找了个类来实现,我用的是vs2008
周药师 2010-09-11
  • 打赏
  • 举报
回复

//WIN7+VS2010
MessageBoxEx(AfxGetMainWnd()-> m_hWnd,L"Hello Word",L"Info", MB_RETRYCANCEL, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
zgsdzhaolanxiang1 2010-09-11
  • 打赏
  • 举报
回复
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
MessageBoxEx(NULL,L"TEXT",L"cg",MB_YESNOCANCEL | MB_DEFBUTTON2,MAKELANGID(0x09,0x01));//英文 美国
return 0;
}
效果如下 WIN7 测试 (WIN7 默认装了英文包)
zgsdzhaolanxiang1 2010-09-11
  • 打赏
  • 举报
回复
学习了
youfeng888 2010-09-11
  • 打赏
  • 举报
回复
告诉大家一个方法:自定义对话框,拖上静态文本框控件,映射变量为 Cstring类型,然后定义接口setMsg
, 很简单的
欢迎来看看
liufang8318 2010-09-10
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 visualeleven 的回复:]
int MessageBoxEx( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType,
WORD wLanguageId);
[/Quote]研究的真是透彻啊,UP
Eleven 2010-09-10
  • 打赏
  • 举报
回复
int MessageBoxEx( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType,
WORD wLanguageId);
dingshaofengbinbin 2010-09-10
  • 打赏
  • 举报
回复
直接写成中文就行了!!???
MessageBox(“世界”,....);
Qlaiaqu 2010-09-10
  • 打赏
  • 举报
回复
在资源视图里面点击该按钮,直接输入中文即可。
shegood1985 2010-09-10
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 firebirdcn 的回复:]
wLanguageId
Specifies the language in which to display the text contained in the predefined push buttons. This value must be in the form returned by theMAKELANGID macro.
For a list of the language……
[/Quote]
哎,哪里去弄这个语言
FireBirdCN 2010-09-10
  • 打赏
  • 举报
回复
wLanguageId
Specifies the language in which to display the text contained in the predefined push buttons. This value must be in the form returned by theMAKELANGID macro.
For a list of the language identifiers supported by Win32, seeLanguage Identifiers. Note that each localized release of Windows and Windows NT typically contains resources only for a limited set of languages. Thus, for example, the U.S. version offers LANG_ENGLISH, the French version offers LANG_FRENCH, the German version offers LANG_GERMAN, and the Japanese version offers LANG_JAPANESE. Each version offers LANG_NEUTRAL. This limits the set of values that can be used with the wLanguageId parameter. Before specifying a language identifier, you should enumerate the locales that are installed on a system.
jogger007 2010-09-10
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 visualeleven 的回复:]
int MessageBoxEx( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType,
WORD wLanguageId);
[/Quote]
部长深不可测。。
hilevel 2010-09-10
  • 打赏
  • 举报
回复
原来还用MessageBoxEx这东西,没用过
chenjelly 2010-09-10
  • 打赏
  • 举报
回复
MessageBoxEx,原来可以这样用。学习了。
ylmbtm 2010-09-10
  • 打赏
  • 举报
回复
先得到这个messagebox的窗口句柄,再得到messageBox对话框上的按钮的句柄,直接调用的SetWindowText修改按钮的句柄,就行了。

怎么找这个窗口的方法千千万万,我只举一个:
1.先用findwindow方法根据messagebox的标题找到messagebox,然后用enumWindow找到button.
dengzikun 2010-09-10
  • 打赏
  • 举报
回复
好象不能改变.自己做一个MESSAGEBOX吧.
孤客天涯 2010-09-10
  • 打赏
  • 举报
回复
不行就用自定义对话框,哈哈
shegood1985 2010-09-10
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 visualeleven 的回复:]
int MessageBoxEx( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType,
WORD wLanguageId);
[/Quote]
这种方法试过了,无效
shegood1985 2010-09-10
  • 打赏
  • 举报
回复
问错了,是确定按钮改成英文,我的操作系统是中文操作系统

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧