ActiveX控件不再接收WM_KEYDOWN键盘输入 [英] ActiveX control no longer receiving WM_KEYDOWN keyboard input

查看:90
本文介绍了ActiveX控件不再接收WM_KEYDOWN键盘输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发现我写的一个ActiveX控件在Internet Explorer 8中不起作用,尽管它在IE5,IE6和IE中运行良好。 IE7。
控件使用DirectInput通过调用输入设备上的GetDeviceState()来接收它的键盘状态。对GetDeviceState()的调用表明没有按下任何键,这使我无法读取用户输入。

为了尝试识别问题,我创建了一个新的ActiveX完全控件并添加了一个消息映射这样我就会收到WM_KEYDOWN事件。事实证明这也不起作用,我的控件没有收到WM_KEYDOWN事件。因为我认为这可能是一个焦点问题,我尝试设置WM_LBUTTON_DOWN事件,以捕获鼠标点击。鼠标输入按预期工作,这让我相信这不是Windows焦点问题,而是Internet Explorer 8中的某种保护,这阻止我阅读键盘输入。

我确实有接收键盘输入的解决方法,但包括捕获键盘状态,而不管哪个窗口有焦点。虽然这是可能的,但我认为这是一个安全风险,因为任何人都可以使用我的控件捕获击键,即使最小化Internet Explorer,这可能是某人的密码。

有没有人有解释为什么WM_KEYDOWN和其他键盘输入函数不再在Internet Explorer 8中工作以及如何使其再次工作,而不采用不安全的方法?

I recently discovered that an ActiveX control that I wrote isn't working in Internet Explorer 8, although it has been working fine with IE5, IE6 & IE7.
The control is using DirectInput to receive it's keyboard status, by calling GetDeviceState() on the input device. The call to GetDeviceState() is indicating that no keys are being pressed, which prevents me from reading the user input.

To try to identify the problem I created a new ActiveX full control and adding a message mapping so that I would receive WM_KEYDOWN events. This turned out to not work either, the WM_KEYDOWN events are not being received by my control. Because I thought that this might be a focus problem, I tried setting up a WM_LBUTTON_DOWN event, to capture mouse clicks. Mouse input was working as intended, which leads me to believe that this is not a windows focus issue, but some sort of protection in Internet Explorer 8, which is preventing me from reading keyboard input.

I do have a workaround for receiving keyboard input, but that includes capturing the keyboard state regardless of which window has focus. Although this would be possible, I consider it to be a security risk, since anybody could use my control to capture keystrokes even when Internet Explorer is minimized, which could potentially be someone's password.

Does anyone have an explanation as to why WM_KEYDOWN and other keyboard input functions is no longer working in Internet Explorer 8 and how to make it work again, without resorting to insecure methods ?

推荐答案

我仍然有兴趣听到任何ActiveX开发人员拥有能够接收键盘输入的控件。我知道Abobe Flash和Microsoft Silverlight仍然可以接收按键,因此必须有一种接收键盘输入的方法。

I am still interested in hearing from any ActiveX developer who has a control that is able to receive keyboard input. I know that Abobe Flash and Microsoft Silverlight are still able to receive keypresses, so there must be a way to receive the keyboard input.


这篇关于ActiveX控件不再接收WM_KEYDOWN键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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