加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

winapi – Windows XP与Vista的SetThreadUILanguage?

发布时间:2020-12-13 21:32:02 所属栏目:Windows 来源:网络整理
导读:docs for SetThreadUILanguage 表示: Windows XP: The application can only set this parameter to 0. This setting causes the function to select the language that best supports the console display. For more information,see the Remarks section.
docs for SetThreadUILanguage表示:

Windows XP: The application can only set this parameter to 0. This
setting causes the function to select the language that best supports
the console display. For more information,see the Remarks section.

它后来继续(相当隐藏在段落的中间):

(…) Windows XP does not support a concept of thread user interface
language separate from thread locale. Therefore,this function changes
the thread locale on Windows XP. (…)

事实上这似乎就是发生了什么,也就是说,在Windows XP上调用SetThreadUILanguage似乎相当于调用SetThreadLocale,而在Vista上它似乎与调用SetThreadPreferredUILanguages基本相同(在XP上根本不可用) ).

文档对我来说很明显,所以我的基本问题可能是:我是否应该在Windows XP上调用SetThreadUILanguage来更改(首选)UI语言并在某处正确记录,在Windows 7上,我应该调用这个功能,或者我应该调用SetThreadPreferredUILanguages?

我知道这是一个老线程,但我很好奇你是否找到了解决方案?我正在处理同样的问题,我对微软的文档感到非常困惑.这是我到目前为止学到的东西:

1 SetThreadLocale几乎没用.我真的不确定它到底做了什么. MSDN page here首先声明:

SetThreadLocale affects the selection of resources with a LANGUAGE
statement. The statement affects such functions as CreateDialog,
DialogBox,LoadMenu,LoadString,and FindResource. It sets the code
page implied by CP_THREAD_ACP,but does not affect FindResourceEx.

好.我得到这个部分.但它有这个“宝石”:

Windows Vista and later: Do not use SetThreadLocale to select a user
interface language.

现在它是纯粹的微软:)那么上面段落中的所有羞辱是什么?

2 SetThreadUILanguage仅适用于Vista及更高版本的操作系统.在XP上它几乎没有什么,所以除非你想错过仍然坚持使用XP的大量用户,否则这个API现在也没用. (它似乎在Vista和后来的操作系统上完成了所有工作.)

3 SetThreadPreferredUILanguages仅适用于Vista和更高版本的操作系统,所以我们回到缺乏XP支持.根据我的理解,如果你在资源中包含一堆语言,请说出这三种语言:美国英语,法语,德语.当资源加载器加载它时,例如,在瑞士,一个愚蠢的微软加载器将默认选择美国英语.所以这个API告诉它使用什么语言. (我知道,完全多余,但是,嘿,记住,我们正在与微软打交道.)

我似乎无法解决的问题是如何在XP中定义UI语言.可以将FindResourceEx用于字符串和对话框(使用CreateDialogIndirect),但是文件打开/保存对话框或GetOpenFileName和属性表或CPropertySheet呢?

所以我很好奇你是怎么处理它的?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读