首先是MessageBox中如何将按钮中的文字显示为其他语言。MessageBox要使用 MessageBoxEx才可以,其定义如下:
int WINAPI MessageBoxEx(
_In_opt_ HWND hWnd,
_In_opt_ LPCTSTR lpText,
_In_opt_ LPCTSTR lpCaption,
_In_ UINT uType,
_In_ WORD wLanguageId
);
最后一个参数MSDN上给出的解释是:
wLanguageId [in]
Type: WORD
The language for the text displayed in the message box button(s). Specifying a value of zero (0) indicates to display the button text in the default system language. If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more information, see MAKELANGID.
意思就是我们需要用函数MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),来生成最后一个参数。它的定义为
WORD MAKELANGID(
USHORT usPrimaryLanguage,
USHORT usSubLanguage
);
微软给我们提供了足够多的语言支持,关于这两个参数可以参见微软提供的Language Identifier Constants and Strings表格。从表格中查找相应的语言的PrimaryLanguage和SubLanguage即可。如英语为:LANG_ENGLISH 和 SUBLANG_ENGLISH_US ,可以写成MAKELANGID(LANG_ENGLISH , UBLANG_ENGLISH_US );
最后举一个例子:
MessageBoxEx(NULL,L"This is an English MessageBox!",L"Alert",MB_OKCANCEL,MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

下面介绍一下如何修改Dialog中的默认按钮上的文字,这里只介绍系统定义的Dialog,如:CFileDialog。(Customer Dialog 也没有做这些的意义了,因为直接修改按钮的Caption 属性即可)。修改Dialog的默认按钮文字只需要在创建Dialog前加上一句:
SetThreadUILanguage(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
即可,参数中MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)的使用和上文的使用方法中一样。