I am making a program which is supposed to change keyboard inputs and layout globally. Any kind of help appreciated.
I have used this code before, but nothing happened:
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("ZH-CN"));
Nothing happens on my machine either. I don't actually have that keyboard layout installed. So it just stays en-US and there's no exception.
You'll have to add the keyboard layout first. On Windows 8, that's done with Control Panel, Language, "Add a language" link, pick one of the Chinese keyboard layouts. Now it does work on my machine. The procedure is different on earlier versions of Windows, follow up at superuser.com if you need more help.