c++ - 在 Windows 10 语言列表中添加语言条目
问题描述
我需要使用 C++ 和 MFC 框架在 Windows 10 运行时(特别是中文和日文)中创建一个新的语言条目。
见下图:
我已经实现了一个虚拟键盘和一个语言设置对话框,它根据所选语言更改输入语言。我已经使用了 LoadKeyboardLayout 和 ActivateKeyboardLayout WINAPI 函数,适用于其他语言,但不适用于中文和日文(它需要两种语言都在 Windows 10 语言列表中才能工作)所以我想知道是否有任何方法可以动态添加这两种语言在 Windows 10 语言列表中。
请参见下面的代码:
void OSKSettingsDialog::SetKeyboardInputLanguage(LPCWSTR idLanguage)
{
HKL desiredhk1 = LoadKeyboardLayout(idLanguage, 0);
ActivateKeyboardLayout(desiredhk1, KLF_SETFORPROCESS);
}
SetKeyboardInputLanguage(L"00000409"); //input locale id of english language(WORKS FINE)
SetKeyboardInputLanguage(L"00000804"); //input locale id of chinese (FAILS)
SetKeyboardInputLanguage(L"00000411"); //input locale id of japanese (FAILS)
SetKeyboardInputLanguage(L"00000816"); //input locale id of portuguese (WORKS FINE)
有什么办法吗?
我将不胜感激任何帮助。
解决方案
推荐阅读
- prometheus - 实现 prometheus_client.multiprocess.MultiProcessCollector 的正确方法(Django + Celery)
- node.js - Knex.js - 节点进程永远不会退出,如何优雅地关闭它 - 但只有在所有查询都得到解决时?
- c++ - cmake mingw-w64:尝试构建时出现奇怪的错误
- android - 在 firebase 数据库中搜索返回空值
- java - 如何将编译好的 Groovy 脚本存储在数据库中,并在需要时获取?
- python - 如何将“字符串”输出转换为 JSON 格式的数字输出?
- javascript - 如何在画布动画的 While 循环的每次迭代之间添加延迟?
- docker - 通过 docker-compose 对其他计算机进行 sshfs 的最佳实践,但不想公开公开端口
- azure - 在 Azure 文件共享中存储按上次修改日期排序的文件
- python - 摆图模拟 Matplotlib - 来自文件的数据