我想从前台窗口读取鼠标选择的文本,而不使用剪贴板 [英] I want to read Mouse selected text from foreground window without using clipboard

查看:107
本文介绍了我想从前台窗口读取鼠标选择的文本,而不使用剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何Windows应用程序进程接口从前台窗口读取选定/突出显示的文本。

Is there any windows application process interface to read selected/highlighted text from foreground window .

推荐答案

为此目的提供了可访问性界面。在Windows的历史上有各种各样的界面。今天推荐的API是 UI Automation 。可以在MSDN上找到概述: Windows自动化API概述

The accessibility interfaces are provided for this purpose. There have been various such interfaces in the history of Windows. Today, the recommended API is UI Automation. An overview can be found on MSDN: Windows Automation API Overview.

为每个应用程序中的所有控件都不会自动提交的事实做好准备。一般来说,可能无法期望从存在的每个应用程序中读取文本。但是,良好的应用程序将支持自动化。

Be prepared for the fact that not all controls in every application will submit to automation. In general it is probably impossible to expect to read text from every application in existence. However, well behaved applications will support automation.

这篇关于我想从前台窗口读取鼠标选择的文本,而不使用剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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