The application will be installed by users from different countries, and what languages the keyboard layout of a specific user is unknown. We need a way with which the keyboard layout will change.
Asked
Active
Viewed 103 times
-1
-
Do you know that language and keyboard layout is not same? – user2120666 Apr 23 '20 at 17:59
1 Answers
-2
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern bool PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public void ChangeLanguage()
{
PostMessage(GetForegroundWindow(), 0x0050, 2, 0);
}