;*PW2: NONEMIN.WAS - Sets PW2 DATA Connection Port and PW2 FAX Connection * ;* Ports to None, Minimizes PW2, waits, and when the user Restores * ;* it sets both PW2's Ports back from None to Previous settings. The * ;* Ports are thus free for use while PW is minimized using this script. * ;* * ;* Freeware, no liability for use by others assumed or implied. * ;* * ;* -Paul Heim, CIS UID 74066,635 * ;****************************************************************************** PROC MAIN ;label for main procedure STRING PREVDATPORT ;string to hold previous DATA port name STRING PREVFAXPORT ;string to hold previous FAX prt name DIALOGBOX 0 230 45 120 50 286 "NONEMIN.WAX" TEXT 1 10 10 100 10 "Setting PW2 Ports to `"None`"" CENTER;text TEXT 2 10 20 100 10 "and Minimizing. Wait!" CENTER ;text TEXT 3 10 30 100 10 "Note Status Line Messages." CENTER ;text ENDDIALOG ;end dialog box FETCH MODEM PORT PREVDATPORT ;fetch the present modem port and store it FETCH FAX PORT PREVFAXPORT ;fetch the present dataport and store it SET MODEM PORT NONE ;set the modem port to none PAUSE 2 ;pause while it happens SET FAX PORT NONE ;set the fax port to none PAUSE 2 ;pause while it happens WINMINIMIZE $PWMAINWIN ;minimize PW to an icon in program manager DLGDESTROY 0 CANCEL ;destroy the dialog box if it wasn't WHILE 1 ;start while loop IF $PWMAINWIN == $FOCUSWIN ;if user restores PW EXITWHILE ;exit the while loop ENDIF ;end the if ENDWHILE ;end the while DIALOGBOX 0 230 45 120 50 286 "NONEMIN.WAX" ;dialog box TEXT 1 10 10 100 10 "Restoring Previous PW2" CENTER ;text TEXT 2 10 20 100 10 "Connection Ports. Wait!" CENTER ;text TEXT 3 10 30 100 10 "Note Status Line Messages" CENTER ;text ENDDIALOG ;end dialog box WINACTIVATE $PWMAINWIN ;just to be real sure where focus is STATMSG "Restoring previous Data Port ..." ;status line message SET MODEM PORT PREVDATPORT ;restore previous DATA port WAITFOR "OK" 10 ;when the modem data pport is restored WHILE $TXCOUNT ; the modem init string is sent, ENDWHILE ; perhaps several strings, WHILE $RXCOUNT ; and this whole bit waits for it ENDWHILE ; to happen and then also PAUSE 2 ; does a pause for good measure STATMSG "Restoring previous Fax Port ..." SET FAX PORT PREVFAXPORT ;restore previous FAX port WHILE $TXCOUNT ;same waiting as above ENDWHILE WHILE $RXCOUNT ENDWHILE PAUSE 2 ;pause for good measure STATMSG "Previous PW2 Connection Ports Restored by NONEMIN.WAX";status line msg DLGDESTROY 0 CANCEL ;destroy the dialog box WINACTIVATE $PWMAINWIN ;just to be real sure where focus is EXIT ;exit this script ENDPROC ;label to end procedure ; ;end of script