Get Keyboard name
Can Do
Thanks for visiting my site lucky visitor:
This page was last updated on: April 8, 2007
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page
Google
Search WWW Search My Site!

The following is a method to get the real (localized) keyboard layout name for Windows XP onwards as opposed to the ID number.

The reason I give you this method is that the typical API way relies on constants where as this method gets it from YOUR registry @

HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\

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

00000402
00000405
00000406 etc

The above 8 digit subkey represents a KLID (Keyboard Layout Identifer) for a specific keyboard layout in hexadecimal.

(The API functions will give you this number, hence the need for the constants.
eg see http://www.ex-designz.net/apidetail.asp?api_id=445 )

Clicking on these keys gives;

   Layout Display Name    @%SystemRoot%\system32\input.dll,-5053
   Layout File                      KBDBU.DLL
   Layout Text                     Bulgarian

where (See Fig.1);

Layout Display Name = This value only exists in XP and later; it contains a string suitable for interpretation by the SHLoadIndirectString function from SHLWAPI Dll, which is a pointer to a string in a DLL that contains the localized name of the keyboard layout, based on the current UI language.

Layout File = The name of the keyboard layout DLL. This Dll contains the KB layer descriptor, i.e the key names like UP, DOWN etc.

Layout Text = the localized, hard-coded name of the keyboard; for XP and beyond, this is the English name of the keyboard.

Fig.1