getkeyboardlayoutname (user32)
Last changed: -213.145.101.2

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool GetKeyboardLayoutName([Out] StringBuilder pwszKLID);

or you can use this approach (see also the sample code below)

[DllImport("user32")]
public static extern bool GetKeyboardLayoutName(IntPtr pwszKLID);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

  [DllImport("user32")]
  public static extern bool GetKeyboardLayoutName(IntPtr pwszKLID);
  System.Text.StringBuilder locale = new System.Text.StringBuilder(new string(' ', 256));
  int length;
  string keyboardLanguage;
  length = GetKeyboardLayoutName(locale);
  keyboardLanguage = locale.ToString().Substring(0, length);

Alternative Managed API:

Do you know one? Please contribute it!

Documentation