Getting the Windows Startup Message Language

I am currently trying to get hold of the MUI and getting some problems with GetSystemDefaultUILanguage - this does not return the expected language:

Welcome screen and new user accounts settings dialog

Users can set the language used to start Windows in the Welcome and New User Account Settings dialog box, which claims to copy the language settings to the system accounts. So I could get the language used when running the messages using GetSystemDefaultUILanguage, but it only seems to come back with the language used for the initial OS installation. How can I get the language of the startup messages?

+3


source to share


1 answer


It looks like GetSystemDefaultUILanguage returns the language the OS was installed in. In 2K8 R2, at least (and possibly other OSs after Vista), users can change the language used to load messages, but this is unfortunately not reflected in GetSystemDefaultUILanguage.

However, it can be viewed through the registry. The following value stores a textual description (for example, en-US) of the language:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MUI\Settings\PreferredUILanguages

      

This value is displayed only on computers with multiple languages โ€‹โ€‹installed (and possibly only when the user has changed the greeting language).



So, to get the current greeting language, the flow looks like this:

  • Trying to read PreferredUILanguages
  • If found, parse language id
  • Otherwise call GetSystemDefaultUilanguage
  • Load the appropriate language resources given the returned language ID

It wouldn't be such a pain if we weren't trying to display things in a different language at boot time! Usually you can just use GetUserDefaultUilanguage.

+1


source







All Articles