public static void CycleAllLayouts(IntPtr hwnd) { self_change = true; for (int i = MMain.locales.Length; i != 0; i--) { if (MMain.MahouActive()) { return; // Else creates invalid culture 0 exception. } WinAPI.SendMessage(hwnd, (int)WinAPI.WM_INPUTLANGCHANGEREQUEST, 0, WinAPI.HKL_NEXT); // Thread.Sleep(5); // WinAPI.SendMessage(hwnd, (int)WinAPI.WM_INPUTLANGCHANGEREQUEST, 0, (int)WinAPI.HKL_PREV); } self_change = false; }
void btnLangChange_Click(object sender, EventArgs e) { if (MMain.MyConfs.Read("Locales", "LANGUAGE") == "RU") { MMain.MyConfs.Write("Locales", "LANGUAGE", "EN"); btnLangChange.Text = "EN"; } else if (MMain.MyConfs.Read("Locales", "LANGUAGE") == "EN") { MMain.MyConfs.Write("Locales", "LANGUAGE", "RU"); btnLangChange.Text = "RU"; } MMain.InitLanguage(); RefreshLanguage(); }