I decided to write wrappers around the Windows API function GetLocaleInfo() and I'm hoping someone can verify that I correctly calculated the following values of the first (Locale ID) parameter:
Define LOCALE_NEUTRAL 0
Define LOCALE_SYSTEM_DEFAULT 2048
Define LOCALE_USER_DEFAULT 1024
You're supposed to shift a "sort ID" by 16 bits, a "sub-language ID" by 10 bits, and OR them with the primary language ID.
To get these "default" locales you use primary language ID "LANG_NEUTRAL" (which is 0) with sort ID SORT_DEFAULT (which is 0) and one of the following sub-language IDs:
Define SUBLANG_NEUTRAL 0
Define SUBLANG_DEFAULT 1 ' user default
Define SUBLANG_SYS_DEFAULT 2 ' system default
With Windows Vista and later, the function GetLocaleInfoEx() is available, where you use a locale name instead of an integer code. But if you pass one of these three magic values into GetLocaleInfoEx it treats the value as an integer instead of a pointer.
Spencer
Mea culpa; the last paragraph is wrong. I'll just worry about GetLocaleInfo for now.
Spencer