I want to change the input language of the active window.
The problem is that the active window is not my application.
I know about InputLanguage.CurrentInputLanguage = lang;
but it changes the language for my WinForms application and not for the active application.
Summary: my situation is that my program listens to any keyboard event (even when it's not focused) and executes code when I press F1.
I want this press on F1 to change the language to Hebrew in Notepad which was the active application when I pressed F1.
I am interested in either a low level solution or a high level solution.
You should know another application's
hWnd
and post a message for it