visual-c++ - 我在哪里翻译 MFC 消息框

标签 visual-c++ mfc

我正在将 MFC 应用程序本地化为日语,并且资源正常运行。

我目前的问题是,当我使用 AfxMessageBox 时或 MessageBox ,对话框标题和按钮消息以英文显示,我还没有找到任何地方可以更改它。

我没有找到任何有用的搜索 MSDN 或 Google。

所以,

这行得通吗? Windows 是否提供日语、阿拉伯语和俄语的“确定”或“是/否”按钮?

如果没有,我要指定什么来改变这些?

编辑:我和 MessageBoxEx 一起去了, 编写一个包装类,使其像 AfxMessageBox 一样方便使用.看来 MB_OK在英语和日语中显示为“OK”,但其他按钮选项如 MB_YESNO被翻译成我认为是正确的日语。这是一个相当小的翻译应用程序,我们可能希望对较大的应用程序使用自动化。

最佳答案

使用 MessageBoxEx并指定 WORD wLanguageId 字段。

wLanguageId [in] Specifies 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可以在这里找到。

如果这对您不起作用,另一种方法是制作您自己的对话框。

关于visual-c++ - 我在哪里翻译 MFC 消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/603402/

相关文章:

c++ - __uuidof(someVar) 是做什么的?

c++ - 指向静态类成员

c++ - 在 C++ MFC 应用程序中绘制图形

c++ - 由 JOB 中的进程启动的子进程能否将 JOB 属性设置为脱离作业?

c++ - 标准 C++ 中有 safe_cast 吗?

c++ - VC2012错误C2676,VC2005错误C2784 : reverse_iterator for map of template classes

c++ - MFC CFormView OnKeyDown 事件未触发

c++ - 手动替代消息映射?

c++ - DLL中单例的销毁

c++ - 尝试使用 MFC 对象时出现访问冲突