本帖最后由 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()
|