Locale IDs for GetLocaleInfo

337 views
Skip to first unread message

Spencer Simpson

unread,
Jun 29, 2010, 3:52:10 PM6/29/10
to mapi...@googlegroups.com

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

 

Spencer Simpson

unread,
Jun 29, 2010, 4:08:59 PM6/29/10
to mapi...@googlegroups.com

Mea culpa; the last paragraph is wrong.   I'll just worry about GetLocaleInfo for now.    

 


Spencer


--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
Reply all
Reply to author
Forward
0 new messages