0

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)?

James Russell
  • 339
  • 1
  • 3
  • 12

1 Answers1

1

Michael Kaplan blogged about those messages being broken in 2006 here:

http://www.siao2.com/2006/05/16/598980.aspx

He goes on to talk about how you can get notifications directly from the Text Services Framework and gives a link to MSDN that is broken. I believe this one is compatible:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms629032.aspx

The sample code he mentions can be found in links on that page.

Will this work globally? I'm not familiar enough with Text Services Framework to know, but this is a good place to start looking.

Community
  • 1
  • 1
Tergiver
  • 14,171
  • 3
  • 41
  • 68