How to send WM_INPUTLANGCHANGEREQUEST to app with modal window?
问题 I wrote a keyboard switcher, which works well, but fails if current application has modal window opened. On keyboard switch I do the following hwnd = GetForegroundWindow(); PostMessage(hwnd, WM_INPUTLANGCHANGEREQUEST, IntPtr.Zero, handle); where [DllImport("User32.dll", EntryPoint = "PostMessage")] private static extern int PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); but the language does not change.