I'm writing an application which will behave differently depending on the selected keyboard layout. I've been searching and I saw that there's a message that applications receive whenever the layout is changed for that application (WM_INPUTLANGCHANGE, in essence if it has the focus when the layout is changed).
But what I'd like is to be notified whenever the keyboard layout changes, not only if that application has the focus; for example if the change happens when you're working in Word.
Anyone knows if that would be possible? Maybe hooking some function call or processes in memory (I'm talking without even knowing if this is possible)?