把messagebox中的按钮改成中文

时间:2022-05-22 09:22:39
RT,好像很困难,不过如果有哪位大哥有现成的类的话麻烦给一个

20 个解决方案

#1


在资源视图里面点击该按钮,直接输入中文即可。

#2


直接写成中文就行了!!???
MessageBox(“世界”,....);

#3


int MessageBoxEx(          HWND hWnd,
    LPCTSTR lpText,
    LPCTSTR lpCaption,
    UINT uType,
     WORD wLanguageId);

#4


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);
研究的真是透彻啊,UP

#5


问错了,是确定按钮改成英文,我的操作系统是中文操作系统

#6


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);

这种方法试过了,无效

#7


不行就用自定义对话框,哈哈

#8


好象不能改变.自己做一个MESSAGEBOX吧.

#9


先得到这个messagebox的窗口句柄,再得到messageBox对话框上的按钮的句柄,直接调用的SetWindowText修改按钮的句柄,就行了。

怎么找这个窗口的方法千千万万,我只举一个:
1.先用findwindow方法根据messagebox的标题找到messagebox,然后用enumWindow找到button.

#10


MessageBoxEx,原来可以这样用。学习了。

#11


该回复于2010-09-18 20:50:38被版主删除

#12


原来还用MessageBoxEx这东西,没用过

#13


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);

部长深不可测。。

#14


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. 

#15


引用 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……

哎,哪里去弄这个语言

#16


告诉大家一个方法:自定义对话框,拖上静态文本框控件,映射变量为 Cstring类型,然后定义接口setMsg
, 很简单的
欢迎来看看

#17


学习了

#18


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 默认装了英文包)
把messagebox中的按钮改成中文

#19



//WIN7+VS2010
MessageBoxEx(AfxGetMainWnd()-> m_hWnd,L"Hello Word",L"Info", MB_RETRYCANCEL, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

#20


谢谢各位,上面的方法必须有语言包才行,最后还是在codeproject上找了个类来实现,我用的是vs2008

#1


在资源视图里面点击该按钮,直接输入中文即可。

#2


直接写成中文就行了!!???
MessageBox(“世界”,....);

#3


int MessageBoxEx(          HWND hWnd,
    LPCTSTR lpText,
    LPCTSTR lpCaption,
    UINT uType,
     WORD wLanguageId);

#4


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);
研究的真是透彻啊,UP

#5


问错了,是确定按钮改成英文,我的操作系统是中文操作系统

#6


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);

这种方法试过了,无效

#7


不行就用自定义对话框,哈哈

#8


好象不能改变.自己做一个MESSAGEBOX吧.

#9


先得到这个messagebox的窗口句柄,再得到messageBox对话框上的按钮的句柄,直接调用的SetWindowText修改按钮的句柄,就行了。

怎么找这个窗口的方法千千万万,我只举一个:
1.先用findwindow方法根据messagebox的标题找到messagebox,然后用enumWindow找到button.

#10


MessageBoxEx,原来可以这样用。学习了。

#11


该回复于2010-09-18 20:50:38被版主删除

#12


原来还用MessageBoxEx这东西,没用过

#13


引用 3 楼 visualeleven 的回复:
int MessageBoxEx( HWND hWnd,
  LPCTSTR lpText,
  LPCTSTR lpCaption,
  UINT uType,
  WORD wLanguageId);

部长深不可测。。

#14


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. 

#15


引用 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……

哎,哪里去弄这个语言

#16


告诉大家一个方法:自定义对话框,拖上静态文本框控件,映射变量为 Cstring类型,然后定义接口setMsg
, 很简单的
欢迎来看看

#17


学习了

#18


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 默认装了英文包)
把messagebox中的按钮改成中文

#19



//WIN7+VS2010
MessageBoxEx(AfxGetMainWnd()-> m_hWnd,L"Hello Word",L"Info", MB_RETRYCANCEL, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

#20


谢谢各位,上面的方法必须有语言包才行,最后还是在codeproject上找了个类来实现,我用的是vs2008

#21