Change Keyboard Layout for Other Process

Posted by SLaks on Stack Overflow See other posts from Stack Overflow or by SLaks
Published on 2008-11-04T20:16:45Z Indexed on 2010/04/25 4:23 UTC
Read the original article Hit count: 331

Filed under:
|
|
|
|

I'm writing a program in C# that runs in the background and allows users to use a htokey to switch keyboard layouts in the active window. (Windows only supports CTRL+SHIFT & ALT+SHIFT)

I'm using RegisterHotKey to catch the hotkey, & it's working fine.

The problem is that I can't find any API to change the keyboard layout for the focused window.

ActivateKeyboardLayout and LoadKeyboardLayout can only change the keyboard layout for the calling thread.

Does anyone know how to change the keyboard layout for a different thread (the way the Language Bar does)?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winapi