[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: dos/nv/x/z



Reply to note from Harry Binswanger  Sun, 02 Jan
2011 15:08:04 -0500

Harry:

> I would like to have XPL launch Firefox then return
> automatically to XyWrite, with XyWrite having Window's "focus"
> as the active window.

Here's a reliable way to do it, using the Window handle (hWnd) for
Editor.exe's session. It requires a couple of Robert's utils
(GOXY.EXE and MyPID.EXE). Here's the one-time setup:

1) Grab goxyplus.zip here:

http://users.datarealm.com/ammaze/xfer/goxyplus.zip

Unzip the contents into Editor's directory. There are three files,
GOXY.EXE, GO.TXT (documentation for GOXY.EXE), and MyPID.EXE.
MyPID.EXE identifies the Process ID (PID), hWnd and Title for the
running XyWrite session. GOXY.EXE switches focus to XyWrite (or any
other running process); it can also do lots of other stuff (read
GO.TXT).

2) Decode and add the following frame MyhWnd,MyPID,MyTitle to U2. It
runs MyPID.EXE, then saves the hWnd (or PID or Title) of the running
XyWrite session to S/G 50. It also saves Editor's directory to S/G
51.

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5MyhWnd,MyPID,MyTitle}} Return Xy|NB hWnd|Process ID|Title
 in S/G50 (and Editor's directory in S/G 51) [CLD][cr|lf]{002
}{<}SX49,{<}VA$FR{>}{>}{<}SX50,{<}VA$ED{>}{>}[JM_]2.GetPath[Q
2_]{<}SX51,{<}IS50{>}{>}[BX_]exist {<}PV51{>}\MyPID.EXE[Q2_]{
<}IF@NOT({<}ER{>}){>}[BX_]do/nv/x/z {<}PV51{>}\MyPID.EXE[Q2_]
{<}SX50,"{<}VA="+{<}IS51{>}+"\MyPID.DAT,"+{<}IS49{>}+"={>}"{>
}{<}SX50,{<}PV50{>}{>}{<}EX{>}{<}EI{>}{<}SV50,{>}{002}[cr|lf]
[cr|lf]
-nd
XPLeNCODE

Now you're ready to write your XPL. The idea is simple. Construct a
BATch file that (A) launches Firefox and your chosen URL, then
(B) runs GOXY.EXE to switch focus back to XyWrite. The following
sample code uses the d:\path for Firefox in your original post and
should work for you "out of the box":

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SV12,http://www.freelists.org/list/xywrite{};*; URL[cr|lf
];*;[cr|lf][JM_]2.MyhWnd[Q2_];*; Save Editor's hWnd to S/G 50
, Editor's dir to S/G 51[cr|lf];*;[cr|lf];*; Construct and sa
ve BATch file[cr|lf]{<}SX01,"@echo off[cr|lf]C:\Progra~1\Mozi
ll~1\firefox.exe "+{<}IS12{>}+"[cr|lf]"+{<}IS51{>}+"\goxy.exe
 w"+{<}IS50{>}{>}[BX_]sa %01,{<}PV51{>}\my.bat[Q2_];*;[cr|lf]
;*;[cr|lf];*; Launch BATch file[cr|lf][BX_]dos/nv/x/z /c {<}P
V51{>}\my.bat[Q2_]{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE

Should work as advertised. Let me know.

--
Carl Distefano
cld@xxxxxxxx