Hi, my question is inline the previous mail.
-----Message d'origine-----
De : Ros-dev [mailto:ros-dev-bounces@reactos.org] De la part de Colin Finck
Envoyé : lundi 7 décembre 2015 04:48
À : ros-dev(a)reactos.org
Objet : Re: [ros-dev] kbswitch update
A proper per-application keyboard layout switcher as
part of the Language
Bar should also be implemented as a shell extension instead of
a tray icon
to be as flexible as the Windows original.
To get notified of focus changes, an application
should probably hook the
EVENT_SYSTEM_FOREGROUND event using the SetWinEventHook
API. The rest can be
done using calls to GetForegroundWindow, GetWindowThreadProcessId and
GetKeyboardLayout as you already suggested.
Shell extension?! Are you completely sure? On windows 2000 and 2003 this is
usually done by an external application, called internat.exe on windows
2000, and ctfmon.exe on windows 2003.
- on windows 2000, internat.exe uses imm32.dll and shell32.dll (the latter
is used to create the language icon in the traybar);
- on windows 2003, ctfmon.exe loads msctf.dll and msutb.dll, having the
effect of creating the toolbar (when it is in floating mode, if you kill
ctfmon.exe you'll see it disappear; however, if it is anchored in the
explorer taskbar, then it'll remain alive until you kill and restart
explorer.exe . Note to myself: it appears explorer.exe loads on demand those
dlls also so that the language bar can be redisplayed if you force-click on
the "Language bar" menu item in the taskbar property menu). On Windows
Vista+, I don't know how it works (but we don't copy vista+ up to now). They
have a language service stuff...
In any case, our current architecture regarding the language bar/icon is
more similar to the one of windows 2000 (but our language app is called
kbswitch.exe instead of internat.exe). But on windows 2000 (contrary to
reactos, and similarly to win2k3), if you select e.g. a german keyboard for
taskmgr while your default keyboard was English, then when you focus on
taskmgr you get the german keyboard and when you focus elsewhere (or open a
new app), you get English (or the other language for that other app), i.e.
as Hans-Peter wants. That's IME stuff, it looks working together with GUI
threads; this needs also some cooperation with user32.dll / win32k.sys;
however the IMM/IME code in win32k is partly broken.
Cheers,
Hermès.