While looking into APMT (IBM EWS), found SAVE_IMAGE function. Occurred to me
that might be possible to grab frames from KMPFS, a feature it seems to lack.
Is. Here's a semi-working demo. I say "semi" because when run from an OS/2
prompt, grabs the frame, but then the calling VIO just disappears. Similar
behavior after making a program object, but since it has only one function,
that might be usable.
Anyone have a clue why it crashes the VIO window? I've had other REXX programs
do that, no error message at all, when trying various RexxUtil functions. No
useful info remains even when "Close window on exit" is checked off.
You need to have KMP running, probably paused. It makes KMP go full screen,
but can live with. Or can modify for other windows if you have the correct
name (see below). The "*" option for current focus also works.
(Yes, I know of screen capture programs. This tests APMT and is useful too.)
------------------------------- snip all after -----------------------------
/* TEST APMT Most here is extracted from examples with APMTST.ZIP. */
/* found at
http://www.quercus-sys.com/rexxfree.htm */
Trace off
call APMT_INIT
/* Following section may be necessary to find window name -- IF it has one. */
/* Does NOT necessarily return same names as either sysqueryswitchlist or */
/* in the window list as displayed! */
/* (When the loop hits Hanisch's ScreenSaver, it starts.) */
/* n = 1
do while SELECT_WINDOW("*",1,n) = 0
rc = QUERY_TITLE("title")
say 'WINDOW NO. 'n ':|'title'|'
n = n+1
end
exit */
rc= SELECT_WINDOW("K Movie Player*","10")
rc= SET_FOCUS()
rc = QUERY_TITLE("title")
say "The selected window's title is " title
rc= SYSMENU_SELECT("Maximize")
rc= WAIT("5000") /* waits out resolution message because goes full screen */
call beep 1000, 100
rc= SAVE_IMAGE( "C:\TEMP.BMP" )
if rc \= 0 then signal apmt_close /* probably not necessary, yet */
APMT_CLOSE:
say 'Message=\'APMTMSG'\'
rc = END_SESSION();
exit
APMT_INIT:
signal on error name errorexit
call rxfuncadd 'APMTLoadFuncs', 'apmtext', 'APMTLoadFuncs'
call APMTLoadFuncs;
rc = INIT_SESSION();
if rc \= 0
then do
say apmtmsg
signal errorexit
├────────────────────────────────────────────────────────────
end
signal on halt name APMT_CLOSE
return