How to get user's current input locale?
Windows supports number of locales installed on the same computer. Current input locale could be important in some cases, for example in password request dialogs. Here is how you can find active locale in your WinForms App to warn user and prevent wrong submitting.
// As a string (e.g. "en"):
string currentISOLangStr = InputLanguage.CurrentInputLanguage.Culture.TwoLetterISOLanguageName;
// As an integer (e.g. 1033)
int currentLangId = InputLanguage.CurrentInputLanguage.Culture.KeyboardLayoutId;
By the way, Windows does that in login window.
Technorati Tags: Globalization,C#
Comments
Anonymous
November 27, 2008
PingBack from http://blog.a-foton.ru/index.php/2008/11/28/how-to-get-users-current-input-locale/Anonymous
December 17, 2008
In the last post we spoke about how to find what locale is currently selected as active. Now it's time