home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / WINDEX.ZIP / WINDEX1.TXT < prev    next >
Encoding:
Text File  |  1991-06-26  |  19.9 KB  |  480 lines

  1.                              WinDEX
  2.                        Windows-DosEXecute
  3.                               V 1.1
  4.  
  5. See Appendix for changes from V 1.0 to V 1.1.
  6.  
  7. WinDEX will be distributed as SHAREWARE.  Version 1.1 is still a
  8. preliminary BETA release distributed as FREEWARE.  If you find this
  9. software useful, you may complete the registration form and send in
  10. $5 to receive the shareware release at no additional charge.  
  11.  
  12. WHAT IS IT?
  13. WinDEX is a Win3 application that allows any one of 6 standard DOS
  14. processes to be executed in the background with results of the
  15. execution reported in WinDEX.  Two programs will be provided in the
  16. package - WINDEXM (manager) and WINDEXU (user).  The programs are
  17. identical except that WINDEXU cannot change any options.  This
  18. allows an "expert" to provide a "user" with a little utility that
  19. they can't mess up. (The preliminary release contains only
  20. WINDEXM.)
  21.  
  22.  
  23. WHY WinDEX?
  24. The author supervises a small Novell network.  Some users had
  25. difficulty in re-directing printer output between local and network
  26. printers.  The Windows control panel method of network printer
  27. management is neither quick nor easy.  WinDEX lets me give these
  28. users a small application that let's them chose a printer and set
  29. capture options by just selecting a customized worded description.
  30.  
  31. WinDEX Requirements:
  32. WinDEX runs under Windows V3.0.  IT IS BEST SUITED FOR THE ENHANCED
  33. MODE OF WINDOWS.  [Note: Version 1.1 adds a Standard mode selection
  34. to improve its execution in standard mode.]  WinDEX requires the
  35. Visual Basic DLL ***NOT INCLUDED***.  The file DBRUN100.DLL is
  36. available in the MSLANG forum of compuserve at no charge.
  37.  
  38. WinDEX uses around 100K of memory.  When executing a DOS shell
  39. command, additional memory is required.  WinDEX comes with PIF
  40. files (WINDEX#.PIF) that can be used to minimize memory
  41. requirements.
  42.  
  43. How it works:
  44. When WinDEX is run, it loads all the information that determines
  45. how it runs from the default data file (WINDEX.DFL) which must be
  46. located in the Windows program directory.  If the file is not
  47. found, defaults can be entered or the sample defaults supplied with
  48. the program may be used.  These defaults control the title of the
  49. window, as well as the description and execution of the choices
  50. displayed.
  51.  
  52. When the user selects one of the 6 choices, a small window displays
  53. the option that will be performed.  Each choice can optionally be
  54. setup to provide for user-input optional text.  When the user
  55. clicks the Execute button, WinDEX launches the command in a
  56. minimized window with output (optionally) re-directed to a
  57. temporary file monitored by WinDEX.  When the launched command
  58. completes, WinDEX displays the output from the command in a small,
  59. scrollable, editable window, and is ready for more action.  The
  60. output can be moved to a larger, resizable window for easier
  61. viewing or editing.  The larger Window supports cut, paste and copy
  62. to and from the Windows clipboard.  The smaller window supports
  63. copy to the clipboard.
  64.  
  65.                           INSTRUCTIONS:
  66. INSTALLATION:
  67.  
  68. Copy the program EXE files to any directory of your choice.  (Note,
  69. WINDEXM.EXE allows you to change options, WINDEXU.EXE does not; you
  70. do not have to place both programs on your system.)
  71.  
  72. Copy the WINDEX.DFL defaults file to your Windows directory. Copy
  73. the .PIF file(s) to your Windows directory (or the directory where
  74. you normally keep .PIF files).  Note - the WINDEX1.PIF file is used
  75. by the sample default applications; the other .PIF files are not
  76. needed unless you create a command that requires more than 128K
  77. memory.  NOTE: The defaults provided with the program use
  78. WINDEX1.PIF, which provides 128K memory.  If you have a large DOS
  79. environment overhead (the amount of available memory less free
  80. memory before starting windows), you may need to provide more
  81. memory.  Edit the PIF settings to provide a larger memory
  82. allocation using the PIF editor that comes with Windows.
  83.  
  84. Run WINDEXM or WINDEXU from the Windows file manager, program
  85. manager, or create a program item in a program manager group to run
  86. WINDEXM or WINDEXU.
  87.  
  88.  
  89. OPERATION:
  90. SET UP OF DEFAULTS  (File - Defaults):
  91.  
  92. It is essential that the default data be entered correctly for the
  93. proper operation of this application.  Being able to enter the data
  94. gives the application tremendous flexibility, but requires some
  95. expertise.  For this reason, a version of the program (WindexU) is
  96. provided that doesn't have a defaults screen - in this case the
  97. fixed pre-programmed options are available until a new defaults
  98. that you create with WinDEXM is placed in the Windows directory.
  99.  
  100. The main defaults screen has two lines of fields for each of the 6
  101. options in the main program:
  102.      The OPTION DESCRIPTION is the text displayed for each
  103. selection in the main window.
  104.      The OPTION COMMAND is the command executed for the selection.
  105. (Note - this is critical - more on this later.)
  106.      The USER INP(ut) checkbox determines whether the main program
  107. will allow optional user input as part of the command.
  108.      The red S box can be clicked on to open the parameters for
  109. optional user input.
  110.      The OUTPUT checkbox determines whether WinDEX will attempt to
  111. redirect the command output into it's scrollable window.
  112.      Either 386Enh mode or Standard Mode must be selected.  When
  113. 386enh is selected, WinDEX will launch the command to run in the
  114. background.  The Windows screen is not disturbed except for an
  115. additional, temporary icon.  In Standard mode, when a command is
  116. launched, Windows switches to the command, which, if output is to
  117. be re-directed to WinDEX, produces a blank screen.  When the
  118. command finishes, the WinDEX window re-appears.  Note- the program
  119. will run with either setting no matter what Windows mode you are
  120. in, but if you select 386Enh mode and are running in standard mode,
  121. you must manually switch to the launched shell before the command
  122. can be executed since standard mode does not allow background DOS
  123. operations.
  124.      The SAVE button saves the defaults.
  125.      The CANCEL button returns to the WinDEX main screen without
  126. saving any changes.
  127.      The EXIT button allows you to exit the defaults screen without
  128. saving the defaults, but using current settings for the current
  129. session.
  130.      The TITLES... button brings up a screen that allows you to put
  131. your own titles in the main WinDEX window.
  132.      The RESTORE button allows you to restore the defaults either
  133. to the last saved values, or to the pre-programmed sample defaults.
  134.  
  135.      Look over the pre-programmed default data to better understand
  136. how this works.  As mentioned, the OPTION COMMAND as well as the
  137. USER INPUT data are critical to successful operation.
  138.  
  139. The OPTION COMMAND must be a valid "Run"-type command.  It must
  140. call a file with one of the following extensions:  BAT COM EXE or
  141. PIF.  While WinDEX can "launch" programs, it's intent is to run
  142. programs that require no operator intervention.
  143.  
  144. When optional user input is allowed, these default fields are
  145. provided:
  146.  
  147. Description before: The main program will display this text before
  148. the user editable input.
  149.  
  150. Description after:  The main program will display this text after
  151. the user editable input.
  152.  
  153. Command before:  The main program adds any text in this area to the
  154. command line BEFORE the user input options.
  155.  
  156. Command after:  The main program adds any text in this area to the
  157. command line AFTER the user input options.
  158.  
  159. Default input: Any text here will appear in the user editable
  160. option text as a default.
  161.  
  162. Space before: If checked, a space will be inserted after COMMAND
  163. BEFORE text before user input.
  164.  
  165. Space after:  If checked, a space will be inserted after the user
  166. input text (before any COMMAND AFTER text).
  167.  
  168.  
  169. Let's look at option 1 as supplied with the program - a DIR command
  170. allowing optional user input.  The command line is:
  171.  
  172.      WINDEX1.PIF /c dir
  173.  
  174. WINDEX1.PIF is provided with the program.  It's paramaters are set
  175. to load COMMAND.COM (and assumes that COMMAND.COM is in the dos
  176. path environment) providing a 128K shell.  The /c parameter is
  177. ESSENTIAL.  It instructs the shell to execute one command and exit. 
  178. This is followed by the DIR - directory command.  If the /c is
  179. missing, the dos shell will produce an error and will not terminate
  180. normally --- in this case you must switch to the Dos Shell (shown
  181. as an icon matching the PIF file spec - WINDDEX1) and EXIT.  
  182.  
  183. The optional user input and output parameters are enabled.  If you
  184. click on the red S net to User Inp(ut), the user input options
  185. screen is displayed:  The description before - Select filespec - is
  186. displayed when this option is selected from the main screen.  The
  187. DEFAULT OPTION parameter - *.* - presents the user with this as the
  188. default response to optional input.
  189.  
  190. When the OUTPUT box is checked - as it is on this example - WinDEX
  191. adds >d:\xxx\~wdx.tmp to the end of the command when it is
  192. executed.  (d:\xxx is windows directory).  This re-directs DOS
  193. output from the command to a file which WinDEX monitors, loads,
  194. deletes and displays.  The file, displayed in a scrollable window
  195. may be edited, as well as copied to the clipboard (Edit-Copy).  
  196.  
  197. Give it a try.... Experiment.  Use common sense - don't create an
  198. entry that does a DEL *.*!  Also see the appendix to this document
  199. for additional examples and ideas of what you can do with WinDEX.
  200.  
  201. Other information:
  202.  
  203. MAIN PROGRAM SCREEN:
  204.  
  205. MENUS -
  206.      FILE---
  207.           DEFAULTS - opens defaults window.
  208.           EXIT - terminates program.
  209.      EDIT---
  210.           COPY - copies marked data in the scrollable window into
  211. the clipboard.  Only active when output is displayed in the window. 
  212.     HELP---
  213.           INFORMATION - brief help.  Help will be enhanced in the
  214. next release.
  215.           ABOUT - displays information about the program.
  216.  
  217. BUTTONS:
  218.      EXECUTE - executes the currently selected command option.    
  219.  DISPLAY - toggles the scrollable window between 3 display modes:
  220. selected command, last executed command, and last command output
  221. results.  When output results mode is selected, the status box
  222. changes color, and may be clicked to open a larger, resizable
  223. window to view and edit the output results.
  224.      
  225. RADIO BUTTONS:
  226.      6 mutually-exclusive buttons used to select the desired
  227. operation.  If a button is selected that allows optional user
  228. input, the radio button area is temporarily replaced with the
  229. options screen:
  230.  
  231.      OPTIONS SCREEN (only appears if a radio button is selected
  232. that allows optional user input):
  233.      Fixed descriptive text is show, with a text box for optional
  234. user input (with a default response if specified in defaults).  The
  235. buttons on this screen are:  OK - accepts optional input, restores
  236. radio button screen, and shows command to be executed in the
  237. scrollable window.  CANCEL - de-selects current option and returns
  238. radio button screen.  You may select EXECUTE directly from the
  239. options screen which launches the command with the currently
  240. entered user options.
  241.  
  242.  
  243. If an invalid command line is specified, one of several events may
  244. occur:
  245.      WinDEX will not run the command, and displays an error
  246. message.
  247.      WinDEX runs the command, but the application launched gets
  248. suspended until the user switches to the application.  If this
  249. occurs, WinDEX will wait until either another WinDEX option is
  250. selected and executed, or the launched application terminates.  If
  251. the user repeatedly executes a command that does not terminate,
  252. eventually system memory will be depleted requiring the user to
  253. switch to and complete the launched application(s).
  254.      Launched applications will appear (briefly) as a WinDEX icon. 
  255. If the application does not terminate, the icon will reamin.
  256.  
  257.      When WinDEX executes a command for which it is told to expect
  258. output, it "sleeps" and periodically checks for output.  While
  259. "sleeping", it responds to mouse click events selecting other
  260. options.  If EXECUTE is selected, warning messages appear
  261. indicating the last process has not completed or produced output. 
  262. If you continue, WinDEX will abort monitoring for output from the
  263. last command.  If the last command's shell has not terminated and
  264. has created, but not written to or closed the output file, WinDEX
  265. will continue to produce error messages until the user closes the
  266. launched command.
  267.  
  268. RUNNING IN STANDARD MODE:
  269.      If you run WinDEX in Windows standard mode, when you execute
  270. a command, it cannot run in the background.  The command launched
  271. will appear as a highlighted icon.  Double-click on the icon, which
  272. will allow the command to be executed; it will complete, and WinDEX
  273. becomes active showing the results, if any.
  274.  
  275. ERROR HANDLING:
  276.      Please report any errors headed with "VISUAL BASIC" to me at
  277. the address shown below.
  278.      If valid commands and options are selected, no error messages
  279. should appear; error messages are generally related to invalid
  280. commands and can be avoided by modifying the defaults file.  Your comments and suggestions regarding this software will be
  281. appreciated:
  282.  
  283.      Richard Gamberg
  284.      1108 Bay Front Road
  285.      Milton, DE  19968
  286.  
  287.      Compuserve Email - 72435,144
  288.  
  289.  
  290. This is a beta release and is being offered as FREEWARE.  However,
  291. if you find the software useful and would like to receive the first
  292. non-beta release at no charge, you may register the software.  This
  293. software is offered as is and without warranty, and your use of
  294. software indicates your consent that the author shall not be liable
  295. for any damages resulting from use of such software.
  296.  
  297.  
  298. Name __________________________________________
  299.  
  300. Address _______________________________________
  301.  
  302. City __________________  State _______  Zip ___________
  303.  
  304. Phone # ______________________________
  305.  
  306. Disk size (3.5 or 5.25) ______________
  307.  
  308.  
  309. Enclose this form with $5 payable to Richard Gamberg and mail to
  310. above address.
  311.  
  312.  
  313. EVEN IF YOU DON'T REGISTER, I'd appreciate your comments -
  314. email (Compuserve 72435,144), fax (302-678-8941) or mail (Richard
  315. Gamberg, 1108 Bay Front Road, Milton, DE 19968) your response:
  316.  
  317. If you took the trouble to get this and don't like it or find it
  318. useful, I'd like to know....
  319.  
  320.  
  321. Do you find WinDEX useful? _____________
  322.  
  323. What changes would you like to see? ____________________________
  324.  
  325. ________________________________________________________________
  326.  
  327. ________________________________________________________________
  328.  
  329. Describe any problems you experienced with WinDEX:
  330.  
  331. ________________________________________________________________
  332.  
  333. ________________________________________________________________
  334. ________________________________________________________________
  335.  
  336. Check any items that you would like to see implemented in the next
  337. release:
  338.  
  339. _____ User-customizable colors and fonts
  340.  
  341. _____ Timed execution option - execute a command at a specified
  342. time.
  343.  
  344. _____ Ability to print output results screen to Windows printer.
  345.  
  346. _____ Multiple user-entered option fields.
  347.  
  348. _____ Ability to perform optional validity check on user-entered
  349. options.
  350.  
  351. _____ Ability to optionally switch focus to the executed command.
  352.  
  353. _____ Multiple default sets - ability to have multiple sets of 6
  354. commands toggled by user on main screen.
  355.  
  356.  
  357. And include below any ideas you have:
  358.  
  359. _________________________________________________________________
  360.  
  361. _________________________________________________________________
  362.  
  363. _________________________________________________________________
  364.  
  365. Thanks.                     APPENDIX
  366.  
  367. Note on PIF files provided with WinDEX: The advanced setting -
  368. Background Priority is increased from normal Windows defaults.  If
  369. WinDEX is used to execute a command, and the user is waiting for
  370. results, this setting is desirable since it gives more time to the
  371. background DOS command.  The Background option is checked - if you
  372. create or change a PIF file and do not have the background option
  373. checked for use with WinDEX, the command will not complete until
  374. you switch into the launched task.
  375.  
  376.  
  377. Ideas and samples for using WinDEX:
  378.  
  379. Redirecting network-local printer output (used with Novell Netware
  380. 2.15C with the capture.exe file in the user's path):
  381.  
  382. Description:  Redirect LPT1 to NetLaser
  383. Command    :  windex1.pif /c capture l=1 q=printq_0 nff nb ti=30
  384. Output box :  Checked - expect output from command
  385. User Input :  Not checked - no user input options
  386.  
  387. When this command is executed, the results of the capture command,
  388. Device LPT1: re-routed to queue PRINTQ_0 on server SERVER
  389. is displayed in the output box.
  390.  
  391.  
  392. You may have a neat little (remember when programs were small) DOS
  393. utility.... like Norton's old FF.EXE (file find).  WinDEX is able
  394. to launch this utility, with user input options, and display the
  395. results:
  396.  
  397. Description:  Norton File Finder
  398. Command    :  windex1.pif /c c:\ni\ff
  399. Output box :  Checked - expect output from command
  400. User Input :  Checked - allows optional user input
  401.   User Input options:
  402.   Description before:  Enter filename to find
  403.   Description after :  (wildcards OK)
  404.   Default option    :  *.bat  (finds BAT files)
  405.     other options not used.
  406. This entry could be made to check all drives by adding:
  407.   Command after     :   /a
  408.   Space after       :   checked (add a space between user input and
  409. command after)
  410.  
  411. There are many ways you can use WinDEX --- here are some ideas:
  412.      Delete files
  413.      Display a fixed directory/subdirectory with fixed options
  414.      Make a sub-directory
  415.      Copy files
  416.      
  417.  
  418. DEFAULT PROGRAM SETTINGS:
  419. When WinDEX can't find it's default file, it will use pre-
  420. programmed options.  You can also use these options by selecting
  421. the RESTORE...Program Defaults option.
  422.  
  423. (1) - Show DOS Version
  424.  
  425. Command     : windex1.pif /c ver
  426. Output box  : Checked - expect output
  427. User Input  : Not checked - no user options
  428.  
  429. (2) - Display TREE of drive
  430.  
  431. Command     : windex1.pif /c tree
  432. Output box  : checked - expect output
  433. User Input  : Checked
  434.  User input options:
  435.  
  436.  
  437. NOTE: The last option included in the default file provided with
  438. WinDEX demonstrates its capability to launch applications.  This
  439. entry runs the Windows Control Panel.  Note when you execute this
  440. option, Control Panel is run minimized as an icon, which must be 
  441. selected to appear on the screen.
  442.  
  443. CHANGES MADE FROM VERSION 1.0 to 1.1:
  444.  
  445. Added standard mode/enhanced mode selection.
  446.  
  447. Version 1.0 would truncate output resulting from a command at 4096
  448. characters.  Version 1.1 supports output of to 31K while using less
  449. memory if the output is smaller than 4K.  Version 1.1 will inform
  450. you if the output is truncated.
  451.  
  452. Version 1.0 would act erratically and produce excessive
  453. error/information messages if a second command was executed while
  454. a first command was still processing or did not produce expected
  455. output.  Version 1.1 changes the Execute button to a Cancel button
  456. while waiting for output.  If the user presses the Cancel button,
  457. the option is given to continue without expecting output.  If a new
  458. command is executed and output was produced in the meantime, a
  459. message is displayed allowing the user to either continue with the
  460. next command, or to view the output.  One problem remains that I
  461. hope to correct in the next version: If Cancel is selected and a
  462. subsequent command executed when the first command is still
  463. processing (which will result in output later), and the user
  464. chooses to continue new execution, file allocation errors on the
  465. disk can occur.  A chkdsk/f (done outside of Windows of course)
  466. will create a .CHK file with the 'lost' output of the first
  467. command.
  468.  
  469. Version 1.0 did not always update the main screen based upon input
  470. in the defaults screen.  This has been corrected.
  471.  
  472. In version 1.0, if the defaults file was missing, or corrupted, the
  473. program didn't respond smoothly.  In version 1.1, if this situation
  474. exists, the user is notified that program defaults are being
  475. restored.
  476.  
  477. In version 1.0, if defaults were changed and then the Exit without
  478. save option was selected, the main screen did not always reflect
  479. the temporary options change.  This is corrected in version 1.1
  480.