GetSystemDefaultUILanguage function (winnls.h)

Retrieves the language identifier for the system default UI language of the operating system (also known as the "install language" on Windows Vista and later). For more information, see User Interface Language Management.


Use of this function is not recommended. Instead, we recommend using the User language settings for the following reasons.

  • "Install language" is only set during the Out of Box Experience (OOBE) and then never changes. If the system language is changed, this function returns an incorrect value.
  • WCOS SKUs always return an incorrect value.
  • This function uses deprecated LANGIDs.


LANGID GetSystemDefaultUILanguage();

Return value

Returns the language identifier for the system default UI language of the operating system. For more information, see the Remarks section.


This function never returns a language identifier for a Language Interface Pack (LIP). It also never returns a language identifier corresponding to the locale identifier LOCALE_CUSTOM_UNSPECIFIED or LOCALE_CUSTOM_UI_DEFAULT.

Note that this function does not necessarily return the identifier for the first language in the system preferred UI languages list. Therefore the return might not match the first element retrieved by GetSystemPreferredUILanguages.

C# Signature

[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
        static extern System.UInt16 GetSystemDefaultUILanguage();


Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winnls.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

EnumUILanguages, GetSystemPreferredUILanguages, GetUserDefaultUILanguage, Multilingual User Interface, Multilingual User Interface Functions