在 Windows 平台通过 GeoID 检测用户所处国家/区域 (#3891)

This commit is contained in:
Glavo
2025-05-04 23:13:40 +08:00
committed by GitHub
parent 1ab7ab0750
commit 2d8b1df465
3 changed files with 31 additions and 1 deletions

View File

@@ -44,4 +44,8 @@ public interface Kernel32 extends StdCallLibrary {
*/
int GetACP();
/**
* @see <a href="https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getusergeoid">GetUserGeoID function</a>
*/
int GetUserGeoID(int geoClass);
}

View File

@@ -36,4 +36,8 @@ public interface WinConstants {
long HKEY_CURRENT_CONFIG = 0x80000005L;
long HKEY_DYN_DATA = 0x80000006L;
long HKEY_CURRENT_USER_LOCAL_SETTINGS = 0x80000007L;
int GEOCLASS_NATION = 16;
int GEOCLASS_REGION = 14;
int GEOCLASS_ALL = 0;
}