
























                                 POWERRUN
			 DEVELOPER'S DOCUMENTATION
                                VERSION 4.0
                             JANUARY 28, 1998

                           COPYRIGHT 1996/98 BY

                              GREG BERTHUME
			 242 BENNETTS BRIDGE ROAD
			      GREER SC 29651

			   VOICE: (864) 879-3467
			     FAX: (864) 801-0210
		      COMPUSERVE: 105707,1224
                        INTERNET: GBerthume@compuserve.com
                             WWW: http://members.aol.com/GBerthume


        LICENSE AGREEMENT FOR POWERRUN (CW Template Addon)
        --------------------------------------------------
        If you do not accept or agree to the terms of this agreement, do not
        use this product.  Return the package within 30 days for a full
        refund.

        This Software is protected under federal copyright law.  Greg Berthume
        retains ownership of this Software product.  This program us licensed to you
        under the following terms:

        1.  You may make copies of this Software solely for backup purposes.
            Duplication of this Software for any other reason including for
            sale, loan, rental, or gift is a federal crime.

        2.  You may use the Software on only one computer at a time.  The
            Software may be transferred for use on a different machine;
            however, it must first be removed from the computer on which it
            was originally installed with the following exception: If the
            software is installed on a computer that is used by one
            individual more than 80% of the time it is in use, that one
            individual may also use the software on a portable or home
            computer.  You may not network the Software or otherwise use it
            on more than one computer terminal at the same time.

        3.  You may permanently transfer the Software and related
            documentation to another user, provided you retain no copies and
            the recipient agrees to the terms of this Agreement.

        4.  You may distribute the applications developed with this Software
            royalty-free, however you may not remove any proprietary notices
            included in these files.


        Unauthorized copying of this Software or the documentation, or
        failure to comply with any of the above restrictions, will result in
        automatic termination of this license.


        LIMITATION OF LIABILITY
        -----------------------
        In no event will Greg Berthume be liable for any damages, including
        loss of data, lost profits, cost of cover, or other indirect,
        special, incidental, economic, or consequential damages arising out
        the use of or inability to use the Software or user documentation.
        This limitation will apply even if Greg Berthume has been advised of
        the possibility of such damage.  In no case shall Greg Berthume's
        liability exceed the amount paid by you for the software.  Some
        states do not allow the limitation or exclusion liability from
        incidental or consequential damages, so the above limitation or
        exclusion may not apply to you.


        RETURN POLICY
        -------------
        A 30 day money back guarantee is provided with the PowerRUN product.
        If for any reason you are not satisfied with this product, eliminate
        all copies of the Software and notify Greg Berthume for a full refund
        (within 30 days of purchase).

        ---------------------------------------------------------------------
        Jan 28, 1998         POWERRUN DEVELOPER'S GUIDE           Version 4.0
        ---------------------------------------------------------------------
        Note: The template kit also includes a free code template for using
        the CWPRINT Clarion ReportWriter print engine, courtesy of Jeroen van
        Helvoort of the Netherlands.  I wanted to provide the ability to
        launch CWPRINT to run minimized (background processing) but
        apparently this is not possible due to CWPRINT limitations.  It can
        be sent to the background by the user however.  There are two CWPRINT
        templates, one that is pre 2003 and a new enhanced one for 2003.


        RUNNING THE DEMO
        ----------------
        I've included the WinTop utility (WIN_TOP.EXE) developed by the
        MicroSoft Windows 95 "Kernel Team".  This is handy program for
        monitoring memory and cpu usage by application and threads.  It also
        allows you to check the priority setting which the demo program
        demonstrates.  Install before running the demo program as it is
        automatically launched.  The demo program requires C4RUNX.DLL

        After installing WinTop, simply run PRUN.EXE


        INSTALLATION
        ------------
        After ordering and receiving the PRABCSRC.ZIP password, PKUNZIP -s?
        PRABCSRC.ZIP to \CLARION4\POWERRUN (or directory of your choosing)

        Copy POWERRUN.TPL and GWINAPI.TPL to your CW template directory.
        Register them.  POWERRUN.TPL is used with ABC apps and GWINAPI.TPL is
        used with 2.003 and earlier template chains.  There is a global and
        local extension as well as several code templates.

        Copy PRUNAPI.CLW and PRUNEQU.CLW to your APP directory or to
        \CLARION4\LIBSRC  These files are necessary for the WinAPI functions
        to work and for your apps to compile without error!

        Simply register the global extension template for each app that will
        utilize it.  The global template provides the prototypes for several
        WinAPI functions as well as the necessary Windows naming conventions.
        These include files can be disabled via checkboxes (if you already
        have them).  You may also add additional WinAPI prototypes.  Several
        global variables are also added.

        If you are using DET/Dictionary Enhancement Templates from The
        Moseley Group, be sure and add the global extension to the DSA app
        (if any) and any other app that uses PowerRUN.

        There are numerous PowerRUN examples in PRUN.APP   Play with the demo
        program to get a feel for the different things you can do with
        PowerRUN.


        PROCEDURE EXTENSION TEMPLATE
        ----------------------------
        Each procedure that will utilize PowerRUN must have this local
        extension template inserted.  The template interface allows you to
        specify the PowerRUN parameters as well as several others.

        Processes that you wish to run in the background and wait until it's
        completion will require you to create a Generic Window with a Timer
        setting of 1 and a Cursor setting of Wait.  Place a message in the
        window such as "Processing Occurring - Please Wait...".

        The window will be displayed while the process is running in the
        background (minimized).  The process is called as a procedure.

        The template allows you to specify the following:

        COMMAND String (with a file lookup button).  A prefix of "!" will
        result in the command being executed literally (ie: variables).

        EXECUTION MODE: The following execution options are allowed:
        0 Run Hidden - User Cannot Access.
        1 Run as a Foreground Window with app getting focus.
        2 Run Minimized with the app getting focus.
        3 Run Maximized with the app getting focus.
        4 Run Minimized with the calling app retaining focus (background processing).
        5 Run as a Window behind the calling app.

        Wait for Background App to Complete/Exit (checkbox)
        This option forces the routine to use an Accept loop and the WinAPI
        function GetModuleFileName (GetExitCodeProcess for 32bit) to
        determine if the background process has completed.


        CREATEPROCESS PRIORITY (32bit Only):
        1 Low - Runs only when system idle.
        2 Normal - Default
        3 High - Can affect multi-tasking, highly responsive.
        4 Realtime - Preempts even operating system actions.


        DISPLAY PREPROCESS MESSAGE (checkbox)
        MESSAGE: (ie: Is the Printer Loaded and Ready?)

        DISPLAY PROCESS COMPLETION MESSAGE (checkbox)
        MESSAGE: (ie: The Process Completed Successfully!)


        CODE TEMPLATE
        -------------
        The local extension must be added to any procedure that will utilize
        the code template.  This adds the PowerRUN execution routine to the
        routines embed.

        Set the extension command string to blank.  We won't be using these
        parameter settings.

        You can embed the PowerRUN routine call at any source code point.
        For example, if you wanted to have pushbutton access to an app such
        as Windows Write/WordPad you could place a button on your window,
        toolbar, etc.  In the Control Event Handling, After Generated
        Code/Accepted embed, select the GWinExec code template.

        You are prompted for the Command and Execution Mode (same as above).


        RUNNING DOS PROCESSES
        ---------------------
        The PowerRUN template solution also comes with a generic PIF and BAT
        to allow you to run DOS processes in the Background and force your CW
        app to wait until it completes.

        The PIF and BAT are basically setup to except up to 6 parameters.
        Modify as necessary.  The PIF is required to force the DOS window to
        Close Window on Exit and Execute in the Background.  You can use the
        PIF to execute any DOS command or program.  See the "Download"
        procedure in the demo app for example of using the PIF, BAT and
        PowerRUN combination.


        SHELLEXECUTE() CODE TEMPLATE
        ----------------------------
        Use to launch the user's default internet browser and load the URL
        you specify.  Can also be used to launch the app associated with the
        document specified, ie: letter.doc might be loaded in MS Word.


        PLAY A WAVE FILE CODE TEMPLATE
        ------------------------------
        Enter a valid .WAV file name.


        TECHNICAL SUPPORT
        -----------------
        I can be reached via CompuServe @ 105707,1224 or
        GBerthume@compuserve.com for Internet email.

        I also frequent the CompuServe TopSpeed forum.

        You may also reach me via telephone @ 864-879-3467 or fax @
        864-801-0210 if you need an instant solution.

        Sincerely,

        Greg Berthume
