WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Miscellaneous

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Textract - Grab Information from the Screen

Keywords: 	  Textract - Grab Information from the Screen

Question:

OK, new DLL, new API.

The DLL file is C:\Textract\Textract.dll

Here is a snip from the header file:

class TextractSource {
public:
TextractSource();
TextractSource& BmpFile(const char *bmpFileName);
TextractSource& Wnd(HWND);
TextractSource& Rect(int ax, int ay, int bx, int by);
TextractSource& DesktopWnd();
TextractSource& TopWnd(const char *windowClass, const char *windowText);
TextractSource& DeepWnd(const char *windowClass, const char *windowText);
TextractSource& SubWnd(const char *windowClass, const char *windowText);
TextractSource& SubDeepWnd(const char *windowClass, const char *windowText);
TextractSource& FindLargestWindow();

const char *BmpFileName; // used if != NULL
HWND W; // used if != NULL
int AX, AY, BX, BY; // used if BmpFileName == NULL and Wnd == NULL
};
This function is supposed to grab information from the screen. Can you help me out???

Answer:

It is a OCR of the screen to capture test from the screen when otherwise difficult.
http://www.structurise.com
It is a $99 DLL, but I think it is possible to make an extender that communicates with it.

You mention that you are having problems getting text from a terminal emulation window. You also mention Rumba in conjunction with this. I primarily use WRQ Reflection and Attachmate as opposed to WallData's Rumba product, but Rumba has always been fairly close to the other two products in basic features. One common feature of these emulators has been that they have a scripting language that can be used to access just about any property of the emulator or the current session that it has with a host system.

These scripting languages in the emulators used to be 100% proprietary but they have gone through many revisions and changes over time. The WRQ Reflection Basic scripting language has finally converged with VBA (Visual Basic for Applications). It is now possible to write straight forward VBA scripts that can be used to manipulate the Reflection emulator in any way that you want to.

The following snippet of WinBatch code works with the Reflection terminal emulator. This snippet simply connects via OLE and retrieves the value of one property. It could, however, be used to tell the emulator to save a copy of the screen contents to a file or perhaps return it a character or line at a time.

; testwrqole.wbt
; 32-bit


Title01 = 'Test WRQ OLE Features'

WRQ = 0
WRQ = ObjectAccess('Reflection4.Application',@FALSE)

Message(Title01,WRQ.UserDirectory)

ObjectClose(WRQ)

exit

And here are the conditions were when I ran my test script. Here they are:

  1. A Reflection emulation session was already up and running. Not the call to ObjectAccess() and the use of the @FALSE flag value.

  2. The OLE server name is "Reflection4.Application" if RWIN4.EXE is running. Using the other Reflection emulators (RWIN1, RWIN2, RWIN8) will require the WinBatch script to be altered to try to talk to the correct OLE server.

    You can learn about OLE server names by going into regedit and looking under the HKEY_CLASSES_ROOT key. All of the OLE server names are registered there. You generally need to check your software's documentation to determine for certain what the OLE server name is that must be used to allow an OLE client to communicate with the OLE server component of your software. I recommend making an expedition into registry land just to get familiar with what's already out there.

    Follow some of the OLE examples that have WinBatch controlling Excel or Word. Those examples have good basic educational value for teaching you how to use WinBatch to control OLE server applications.

  3. I was running Reflection for Regis Graphics (RWIN4) v7.0 (32-bit), but this should work for v6.0 (32-bit) as well. I cannot vouch for what happens with older versions and with 16-bit versions of the Reflection emulators.

Article ID:   W14868
File Created: 2001:11:08:12:40:42
Last Updated: 2001:11:08:12:40:42