在Windows 7中获取语言栏的当前所选语言 [英] get the current selected language of the language bar in windows 7

查看:191
本文介绍了在Windows 7中获取语言栏的当前所选语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7中编写一个键盘记录器(使用SetWindowsHookEx),我需要知道正确的keyboardLayout键被按下。
我试图从ForegroundWindow获取keyboardLayout,这在大多数情况下工作正常,但在Internet Explorer 9它不能按预期工作(它返回错误的布局)。
我想到从语言栏获取布局(因为它显示了当前正在输入的窗口的语言),但我不知道如何检索这些数据。
也许有一个注册表项与此数据或我可以要求语言栏窗口其文本。
任何想法?

I am writing a key logger in windows 7 ( using SetWindowsHookEx ) and I need to know the correct keyboardLayout for the key being pressed. I tried getting the keyboardLayout from the ForegroundWindow and this works fine in most cases but in Internet Explorer 9 it doesn't work as expected (it returns the wrong layout ). I thought about getting the layout from the language bar ( because it shows the language of the window that is currently being typed on ) but I don't know how to retrieve this data. Maybe there is a registry key with this data or I can ask the language bar window for its text. Any ideas ?

推荐答案

不要 GetKeyboardLayout 做你想要的吗?

这篇关于在Windows 7中获取语言栏的当前所选语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆