c++ - 如何在 Windows 10 中检索“区域格式”
问题描述
我正在尝试找出如何检索 Windows 10 上的“区域格式”设置(见下图)。
我试过GetLocaleInfoEx
了,几乎所有的参数组合,但这个没有出现。
另一方面,此设置会影响返回的内容GetThreadLocale
:
GetThreadLocale
根据此 Microsoft 文档,问题末尾的 C++ 代码中的一些具有预期返回值的示例。
+--------------------------+-----------------------------------+
| Regional format | Value returned by GetThreadLocale |
+--------------------------+-----------------------------------+
| French (Switzerland) | 0x100c |
| French (France) | 0x040c |
| German (Germany) | 0x0407 |
| English (United states) | 0x0409 |
| English (United Kingdom) | 0x0809 |
+--------------------------+-----------------------------------+
一些具有意外(和未记录)返回值的示例来自GetThreadLocale
:
+-----------------------+-----------------------------------+
| Regional format | Value returned by GetThreadLocale |
+-----------------------+-----------------------------------+
| English (Switzerland) | 0x0c00 |
| English (Germany) | 0x0c00 |
| German (Italy) | 0x0c00 |
+-----------------------+-----------------------------------+
我真的很想知道这个0x0c00
返回的值GetThreadLocale
是什么?
C++ 代码
#include <windows.h>
#include <stdio.h>
int main()
{
printf("GetThreadLocale: %08x\n", GetThreadLocale());
}
解决方案
推荐阅读
- akka - Thingsboard 中的演员模型
- android - 如何使用rest api调用单击上一个按钮后保持复选框状态
- c# - Linq 除了忽略自定义比较器?
- sql - 内部联接查询不检索最新结果
- node.js - 如何通过聚合加入 3 个集合?
- visual-studio-2017 - Visual Studio 2017 社区版 - Nuget.exe 未找到
- python - 多个外键上的 SQLAlchemy 双内连接
- c# - Mainwindow.xaml 打开时无法设计,但仍从工具箱中删除项目
- docker - 运行 netcore-react 应用程序时出现 docker-compose 错误
- r - 使用 R tmap 包在 2 行中绘制 3 个地图