How can be changed the keyboard layout name label?

by Michael S. Kaplan, published on 2007/01/05 03:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/01/05/1387397.aspx


Regular reader from Romania Christian Secara asks:

How can be changed the keyboard layout names, the ones from the tray icon for example, from a programmatic point of view ?

After installing LIP or MUI, the keyboard layout names have translated names, so there should be a way to change this. Is there a "public" mechanism (API, or smth), or this is reserved for language packs only ?

Cristi

Well, there is no way from a programmatic point of view.

But if you look in the registry where the list of keyboard layouts lives, down in

HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\

and look at any of the subkeys and values under it, e.g. under XP:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000418
    Layout Display Name      @%SystemRoot%\system32\input.dll,-5037
    Layout File                      KBDRO.DLL
    Layout Text                     Romanian

That "Layout Display Name" entry (which has been around since XP) is a string designed for the SHLWAPI SHLoadIndirectString function.

The way that it changes when the UI language changes is the way all of the rest of the resources change -- they load the strings from the appropriate localized DLL...

In versions prior to XP, the Layout Text value is the one that would be used, and its language would not change when the UI language did.

For more info (including a function to enumerate the keyboards), you can look to the post I did this last May entitled Getting the real (localized) name of the keyboard, which I guess points to the best answer -- the search box for this blog! :-)

 

This post brought to you by ţ (U+0163, a.k.a. LATIN SMALL LETTER T WITH CEDILLA)
(because in the words of Buck Murdock, irony can be pretty ironic sometimes!)


# DSpider on 19 Dec 2008 4:55 PM:

Vroiam să zic mulţumesc pt. informaţii ! De aici m-am inspirat si mi-am rezolvat problema. Mersi frumos.

Just wanted to thanks for the info ! This is where I got my inspiration from and fixed my problem. Thanks a lot.


referenced by

2007/05/22 Getting the language of an LCID-less keyboard

go to newer or older post, or back to index or month or day