[DllImport("user32.dll")]
static extern IntPtr LoadKeyboardLayout(string pwszKLID, uint Flags);
None.
None.
set flags to 1 when trying to change language
set flags to 0 when trying to reverse the change
LoadKeyboardLayout("00000429", 1);
//commen on 09 August 2010 by yazeed hamdan,
// This is not alternative, this will set the default input language based on installed keyboard layouts, if
//the layout is not installed in regional settings, nothing will happen, but with LoadKeyboardLayout, the input
//language will be installed if it doesnt exist in regional and language settings.
//switch to Persian(IR) language
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("fa-IR"));
//switch to English(US) language
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("En-US"));