找回密码
 加入
搜索
查看: 4381|回复: 3

[AU3基础] 高手请赐教:利用能抓窗口文字软件提供的dll接口去捕获指定窗口中的文字?

[复制链接]
发表于 2010-3-19 11:45:58 | 显示全部楼层 |阅读模式
本帖最后由 manlty 于 2010-3-19 20:01 编辑



以下是摘录的该捕捉程序的帮助文件里的一段说明:
   1.1.         Creating a TextCaptureX object 
First of all, the TCaptureX library must be registered on 
the system. This can be done using the following command: 

       regsvr32 <path>\TCaptureX.dll 

where <path> is the actual path to the TCaptureX library. 
The   registrations   process   is   automatically  done   from   the 
setup. 

Following are some examples on how to create a TextCaptureX 
object in your application.
Remark: before creating the object, CoInitialize API 
function must be called. 

       1.1.2.           C# 
   -   add   TCaptureX   library   to   the   list   of   the   project 
       references 
       Optionally, you may add at the beginning of the file: 

             using TCaptureXLib; 

       in order to reference          the objects without specifying 
the namespace. 

       The actual creation is: 

             TextCaptureXClass obj = new TextCaptureXClass(); 

       1.1.3.           Visual Basic 
   -   add   TCaptureX   library   to   the   list   of   the   project 
       references 
      The actual creation is: 

         Dim obj As New TextCaptureX 

   1.2.         Using a TextCaptureX object 

TextCaptureX object exposes the following methods: 
   -   GetActiveWindowHwnd 
   -   CaptureInteractive 
   -   CaptureActiveWindow 
   -   GetTextFromPoint 
   -   GetTextFromRect 
1.2.3.            CaptureActiveWindow method 

              HRESULT CaptureActiveWindow([out,retval] BSTR* result); 

This method captures the text from the window that is currently active, 
that   is   the   window   returned   by   the   GetActiveWindowHwnd   method.   The 
return value is the entire text from the active window. 
Remark: The application where this method is called is responsible of 
NOT containing the active window of the system. 

Parameters: 
BSTR* result : the text from the active window 

Examples: 
Visual C++: 

              _bstr_t result = obj->CaptureActiveWindow(); 

C#: 
              string result = obj.CaptureActiveWindow(); 

Visual Basic: 
              Dim result As String 
              result = obj.CaptureActiveWindow() 

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2010-3-19 11:47:55 | 显示全部楼层
请高手写个示范程序,抓活动窗口里的文字
发表于 2010-3-19 15:52:39 | 显示全部楼层
只有out,没有in?
 楼主| 发表于 2010-3-25 15:59:15 | 显示全部楼层
楼上朋友,难道这个dll不是用来截取任意窗口里的文字的吗?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-16 17:37 , Processed in 0.080639 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表