/****************************************************************/
/*           Reset the position of the SETUP.EXE windows        */
/*                                                              */
/*      Author:       Peter Moylan (peter@ee.newcastle.edu.au)  */
/*      Started:      21 September 2000                         */
/*      Last revised: 16 April 2009                             */
/*                                                              */
/*  Usage:                                                      */
/*         resetpos                                             */
/*                                                              */
/*      You can use this when one or more of the windows        */
/*      belonging to SETUP.EXE and/or MONITOR.EXE has moved     */
/*      off-screen.  This script will move the windows to       */
/*      the bottom left of the screen.  You can then run        */
/*      the two programs and move the windows to where you      */
/*      really want them.  Note: run the script when SETUP      */
/*      and MONITOR are NOT running - otherwise they will undo  */
/*      your work by saving their present positions when        */
/*      they exit.                                              */
/*                                                              */
/*  Installation:                                               */
/*      Put this file in the directory containing the INI       */
/*      files. (This is normally the FtpServer main directory)  */
/*                                                              */
/****************************************************************/

CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs
CALL SysLoadFuncs

/* Switch our working directory to the program directory */

PARSE SOURCE rubbish rubbish SrcDir
j = LASTPOS('\', SrcDir)
IF j > 0 THEN SrcDir = LEFT(SrcDir, j-1)
WrkDir = DIRECTORY()
CALL DIRECTORY SrcDir

Nul = D2C(0)
Null8 = Nul||Nul||Nul||Nul||Nul||Nul||Nul||Nul

CALL SysIni 'SETUP.INI', 'WindowPos', 'ALL:', stem
DO j = 1 TO stem.0
    CALL SysIni 'SETUP.INI', 'WindowPos', stem.j, Null8
END

CALL SysIni 'MONITOR.INI', 'WindowPos', 'ALL:', stem
DO j = 1 TO stem.0
    CALL SysIni 'MONITOR.INI', 'WindowPos', stem.j, Null8
END

SAY "The window positions have been reset"
SAY "You may now run SETUP.EXE or MONITOR.EXE"
CALL DIRECTORY WrkDir
EXIT 0

