Groups search result 10 for apmt os/2 |
Ray Appleby wrote:
: Does anyone know of a utility that will capture the contents of a
: window in a text mode? I don't mean a screen capture, but the entire
: contents of the box in a text mode (even if the text continues beyond
: the visible limits of the window). Thanks for any suggestions. :-)
Ray,
You can do this via REXX (included IBM scripting language with
os/2), I've used the EWS (Ibm Employee Written Sofware) APMT
("A PM Tester" package) to do this.
ftp://ftp.cdrom.com/pub/os2/ibm/ews/apmtst.zip
is the package, follow the instructions on how to use it
in the zip file. The key is in the sample os2prt.cmd file
in the archive, in contains an undocumented API function
called QUERY_CLIPBOARD_TEXT("stem") (by undocumented I mean
they don't mention it in the apmtdoc.inf file in the .zip).
APMT virtualizes mouse and menu actions via software, nearly
anything a person does with the mouse/keyboard can be
emulated with it. See especially SYSMENU_SELECT(),
in your case you would do this:
1) load apmt and initialize a session that will use it
if you use apmt a lot, put the 2 'call' lines in
your x:\startup.cmd file where x: is boot drive
call rxfuncadd 'APMTLoadFuncs', 'apmtext', 'APMTLoadFuncs'
call APMTLoadFuncs;
rc = INIT_SESSION();
2) select the active/foreground window and do menu action to
get the text from window to the clipboard
rc = SELECT_WINDOW("*")
rc = SET_FOCUS()
rc = SYSMENU_SELECT("Copy All")
3) now get the text from the clipboard via query_clipboard_text()
so that the argument is a stem that contains the text
(and for example below, I write each line to a file outfile)
Of course, you can do any processing you want to clip.
first. clip.0 = number of entries in clip. and clip.i is
the 'i'th entry in clip so that if clip.0 = N then clip.N is
the last entry.
outfile = "c:\dir1\outfile.txt"
call stream outfile,'c','open write'
if QUERY_CLIPBOARD_TEXT("clip") = 0 then do
do i = 1 to clip.0
call lineout 'outfile', clip.i
end
end
if you don't know rexx, it's easy to learn. There are
great links on the web
http://rexx.hursley.ibm.com/rexx/
is one. REXX is multiplatform so you can apply it elsewhere
(AS/400, MVS, Unix, OS/2, Amiga, etc). Of course apmt
is specific to os/2
Mark
©2002 Google