by Michael S. Kaplan, published on 2008/01/28 09:31 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/01/28/7287476.aspx
Prior posts in the series:
Last time I promised
Next up, I'll cover some of the other settings in the [Configuration] section, or I might cover the language settings. Whichever one I don't do next will be done the time after....
But who are we kidding here? Language settings are always gonna come first for me; we all know that, right?
Not that I like being so boring and predictable, mind you. I'll explain how I have been working on that another day.... :-)
Anyway, the language settings.
We start in the
[System]
section of the file, (by convention) right at the top of the file, and (again, by convention) the first line in the section will be
LangId = x
where x represents one of five different possible values. These possible values are:
1) One of the many LANG_* constants defined in winnt.h from the time that Vista shipped, like LANG_MACEDONIAN or LANG_BENGALI or LANG_TAMIL or whatever, e.g.
LangId = LANG_BENGALI
and yes those spaces are okay there. Let's do me a favor and not get me started on the spaces there....
This seems pretty straightforward, right?
I know the list is the Vista RTM one as at the time after I had just gotten that Amharic IME in (as previously mentioned in Hang on just a [Hansel]Minute! and We weren't Vista heroes, but I think we were kinda heroic), I looked to make sure that LANG_AMHARIC was there, and it wasn't. And most of the new Vista locales weren't either, so I added them. :-)
Then I worked with colleague Jennifer Shepherd to get an icon in for the Amharic input method....
The LANG_* constant works by calling GetLocaleInfo with that value, which means it will expand to LANG_*, SUBLANG_DEFAULT as GetLocaleInfo is wont to do. It will be called with the LOCALE_SABBREVLANGNAME lcype which will be used as described in LOCALE_SABBREVLANGNAME is more than just an ISO-639 code and LOCALE_SABBREVLANGNAME is so not an ISO-639 code.
2) One of the many LANG_* constants defined in winnt.h from the time that Vista shipped, like LANG_MACEDONIAN or LANG_BENGALI or LANG_TAMIL or whatever, followed by a comm a and a space, followed by one of the many SUBLANG_* constants defined in winnt.h from the time Vista shipped, like SUBLANG_DEFAULT or SUBLANG_BENGALI_INDIA or whatever, e,g,
LangId = LANG_BENGALI, SUBLANG_BENGALI_INDIA
Again working the same way via that GetLocaleInfo call, via a MAKELANGID macro to turn the two values into a number and the function will be called with the LOCALE_SABBREVLANGNAME lcype which will be used as described in LOCALE_SABBREVLANGNAME is more than just an ISO-639 code and LOCALE_SABBREVLANGNAME is so not an ISO-639 code.
3) A numeric value of any valid PRIMARYLANGID or LANGID, e.g.
LangId = 0x0409
which will see GetLocaleInfo be called with the LOCALE_SABBREVLANGNAME lcype which will be used as described in LOCALE_SABBREVLANGNAME is more than just an ISO-639 code and LOCALE_SABBREVLANGNAME is so not an ISO-639 code.
4) #2 with a LANG_* constant for the PRIMARYLANGID and 0xFFFF for the SUBLANGID, e.g.
LangId = LANG_BENGALI, 0xFFFF
This odd 0xFFFF value is something that TextTableService.dll thinks of as the neutral setting, and it will then add the input method as n option to all of the SUBLANGID values under that PRIMARYLANGID -- thus under Bengali (India) and Bengali (Bangladesh) in the above example.
5) #3 with the 0xFFFF value (or #2 with 0xFFFF for both PRIMARYLANGID and SUBLANGID values, e.g. either of the following:
LangId = 0xFFFF
LangId = 0xFFFF, 0xFFFF
Either of these values will cause the input method to be included as an option under all languages.
Anyhow....
At this point you may be wondering one or both of the two things I was wondering about:
The answer to both questions will likely not be the one you are looking for (they were not the ones I wanted to hear!).
Not supported.
But just to round out the [System] section information, here are some more entries (these ones pulled from the Yi IME -- you would fill in your own info):
GuidProfile={<fill in your own unique curly-brace delimited GUID value, please!}
Description="Yi Input Method"
Display Description="@%programFiles%\Windows NT\TableTextService\TableTextService.dll,-16"
Note the MUI-friendly string -- you can fill in your own DLL name and string index, obviously....
I'll cover the rest of the settings like icon info in an upcoming post.
This post brought to you by ⑤ (U+2464, aka CIRCLED DIGIT FIVE)
referenced by
2008/10/21 Behond the Table Driven Text Service, Part 14 (Don't expect too much from numbers)
2008/07/25 Behold the Table Driven Text Service, Part 13 (Sinhalification proclamation!)
2008/06/30 Behold the Table Driven Text Service, Part 12 (The knights who say நீ, redux, #2)
2008/06/21 Back to Sri Lanka (conceptually)
2008/02/25 Behold the Table Driven Text Service, Part 11 (The knights who say நீ, redux, #1)
2008/02/11 Behold the Table Driven Text Service, Part 8 (Configuration 'junk in the trunk', part 2)
2008/01/30 Behold the Table Driven Text Service, Part 7 (Configuration 'junk in the trunk', part 1)
2008/01/29 Behold the Table Driven Text Service, Part 6 (it is sufficient to be iconic, aka DaYi, DaYi Aynu!)