How to get selected text from an active application, without using a clipboard

前端 未结 2 1695
一向
一向 2021-01-17 03:07

What am I doing:

My main intent is to enable user friendly text to speech for personal use on Win 7. Approach should work in Google Chrome, VS and Ecl

2条回答
  •  清酒与你
    2021-01-17 03:34

    MS provide accessibility tools that do cover what you're trying to do. If you take a look at documents about screen scraping. In short, every component is accessible in some manner, if you use some of the windows debugging tools you can get to see the component names/structures within. You can then use that, however, its complicated as most times you would need to be very specific for each application you intend to scrape from.

    If you manage to scrape you dont need to use the clipboard, as you can access the text property of the apps direct. Its not something I've had to do, hence, Ive no code to offer off the top of my head, but the term "screen scraping" should point you in the right direction.

提交回复
热议问题