AutomationElement.FocusedElement与AutomationFocusedChanged事件 [英] AutomationElement.FocusedElement vs AutomationFocusedChanged event

查看:183
本文介绍了AutomationElement.FocusedElement与AutomationFocusedChanged事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AutomationElement.FocusedElement不会向我返回Internet Explorer呈现的网页中当前关注的元素。  AutomationFocusedChanged事件可以。 

AutomationElement.FocusedElement does not return to me the currently focused element within an internet explorer rendered webpage.  The AutomationFocusedChanged event does. 

这是我的问题。  AutomationFocusedChanged事件非常慢,所以我试图捕获使用AutomationElement.FocusedElement以1ms间隔设置的System.Windows.Threading.DispatcherTimer中的FocusedElement。 这不是
的工作。 我没有得到实际上有焦点的元素。  FocusedElement一直是包含网页上所有控件的窗格。

Here's my problem.  The AutomationFocusedChanged event is very slow, so instead I'm trying to capture the FocusedElement within a System.Windows.Threading.DispatcherTimer set at a 1ms interval using AutomationElement.FocusedElement.  This doesn't work.  I do not get the element that actually has focus.  The FocusedElement is consistantly the pane holding all the controls on the web page.

我真的需要一些帮助,因为这是生产代码,基本上屏蔽了第三方的数据web 应用程序,可插入我们自己的内部数据库以进行报告。 更多详细信息。 基本上有一个
第三方网页,其中包含一大堆带有相应标签的文本框。 当最终用户在此网页中输入数据时,我的应用程序需要捕获该数据以及相关标签的字段,因此我可以将其插入到数据库中。 
问题是当用户在各种文本框之间切换时,我使用聚焦更改事件的应用程序无法跟上某人快速更改文本框之间的焦点,因此我可能会错过一些最终用户输入
的数据。 我通过突出显示蓝色框(类似于对象检查器黄色边框)向最终用户提供视觉提示,通过突出显示当前聚焦的文本框,但即使使用可视指示器,也可以作为
最终用户,每次切换到不同的文本框时都要等一到两秒钟会令人沮丧。 (我希望我解释得那么好)。

I really need some help here, as this is to be production code to essentially screen scrape data off a 3rd party web application to insert into our own internal database for reporting purposes. More details.  Basically there is a 3rd party webpage that contains a whole bunch of text boxes with corresponding labels.  As end users enter data into this webpage, my application needs to capture that data, and the fields associated labels, so I can insert this into a database.  The problem is when users are switching between the various text boxes, my application using the focused changed event is not able to keep up with someone changing focus between the text boxes quickly, and hence it is possible that I will miss some data that was entered by the end user.  I do provide a visual cue to the end user that their currently focused text box is being monitored by highlighting the box in blue (similar to the object inspectors yellow border), but even with the visual indicator, as an end user, it would be frustrating having to wait one to two seconds everytime they switched to different text box. (I hope I explained that well enough).

任何想法,想法或解决方案都将不胜感激。

Any ideas, or thoughts or solutions would be greatly appreciated.

谢谢,

推荐答案


AutomationElement.FocusedElement不会向我返回Internet Explorer呈现的网页中当前关注的元素。  AutomationFocusedChanged事件可以。 

AutomationElement.FocusedElement does not return to me the currently focused element within an internet explorer rendered webpage.  The AutomationFocusedChanged event does. 

这是我的问题。  AutomationFocusedChanged事件非常慢,所以我试图捕获使用AutomationElement.FocusedElement以1ms间隔设置的System.Windows.Threading.DispatcherTimer中的FocusedElement。 这不是
的工作。 我没有得到实际上有焦点的元素。  FocusedElement一直是包含网页上所有控件的窗格。

Here's my problem.  The AutomationFocusedChanged event is very slow, so instead I'm trying to capture the FocusedElement within a System.Windows.Threading.DispatcherTimer set at a 1ms interval using AutomationElement.FocusedElement.  This doesn't work.  I do not get the element that actually has focus.  The FocusedElement is consistantly the pane holding all the controls on the web page.

我真的需要一些帮助,因为这是生产代码,基本上屏蔽了第三方的数据web 应用程序,可插入我们自己的内部数据库以进行报告。 更多详细信息。 基本上有一个
第三方网页,其中包含一大堆带有相应标签的文本框。 当最终用户在此网页中输入数据时,我的应用程序需要捕获该数据以及相关标签的字段,因此我可以将其插入到数据库中。 
问题是当用户在各种文本框之间切换时,我使用聚焦更改事件的应用程序无法跟上某人快速更改文本框之间的焦点,因此我可能会错过一些最终用户输入
的数据。 我通过突出显示蓝色框(类似于对象检查器黄色边框)向最终用户提供视觉提示,通过突出显示当前聚焦的文本框,但即使使用可视指示器,也可以作为
最终用户,每次切换到不同的文本框时都要等一到两秒钟会令人沮丧。 (我希望我解释得那么好)。

I really need some help here, as this is to be production code to essentially screen scrape data off a 3rd party web application to insert into our own internal database for reporting purposes. More details.  Basically there is a 3rd party webpage that contains a whole bunch of text boxes with corresponding labels.  As end users enter data into this webpage, my application needs to capture that data, and the fields associated labels, so I can insert this into a database.  The problem is when users are switching between the various text boxes, my application using the focused changed event is not able to keep up with someone changing focus between the text boxes quickly, and hence it is possible that I will miss some data that was entered by the end user.  I do provide a visual cue to the end user that their currently focused text box is being monitored by highlighting the box in blue (similar to the object inspectors yellow border), but even with the visual indicator, as an end user, it would be frustrating having to wait one to two seconds everytime they switched to different text box. (I hope I explained that well enough).

任何想法,想法或解决方案都将不胜感激。

Any ideas, or thoughts or solutions would be greatly appreciated.

谢谢,





这篇关于AutomationElement.FocusedElement与AutomationFocusedChanged事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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