I need to hook change keyboard layout event (change input language) for a certain window (another process) and execute some actions in the my main program.
I tried to use global hook for WH_KERBOARD_LL for Shift/Ctrl KeyDown and it works as needed but doesn't hook the virtual keyboard, custom shortcuts etc.
I also tried to use the global WH_CALLWNDPROC hook for WM_INPUTLANGCHANGE, but my application just doesn't get any events (without DLL). Same with the WH_SHELL hook. As far as I understand them doesn't work without a DLL injection.
Actually, there are several questions:
- Is it really true that
WH_CALLWNDPROCstrictly requires a DLL? If so, is it possible to load it into a specific application? I know the HWND and ThreadID of this window (when it is Foreground). How do I get the hooked event back? - Are there any other tricks to hook the keyboard layout change event without a DLL?