GUI ScreenIO for Windows

 ScreenIO.com


Shortcut

The Shortcut API allows you to create a shortcut to any file and place that shortcut on the desktop or in any other location on the computer.  Shortcuts to programs will launch that program.  Shortcuts to other file types will launch the default application for that file type.  You can also create shortcuts to Web sites, which will launch the users browser when clicked.

 

Client/Server issues

This API runs only on the CLIENT side if running in a client server environment. 

Files

Files available to copy to your system:

Usage

   
     COPY WIN32API.
     COPY SHORTCUT.
 
 
* ------------------------: Typical call to create a shortcut
*                         : on the desktop to a program
*
   SET SHCUT-SHOWNORMAL TO TRUE.
   MOVE 'C:\MYPROG.EXE' TO SHCUT-TARGET .
   MOVE 'Launch MyProgram' TO SHCUT-NAME.
*
* ------------------------: Call the API to create the shortcut
*
   SET FUNC-CREATESHORTCUT TO TRUE.
   CALL 'GSWINAPI' USING WIN32API-PARMS
     SHORTCUT-PARMS
     WIN32API-B
     WIN32API-C
     WIN32API-D
     WIN32API-E
     WIN32API-F.
*
                          

Parameters specific to this function

SHCUT-CMDSHOW

This field has a set of 88s so that you can select how application that is launched will appear, hidden, normal, maximized, minimized and no-activate (not too useful).  Normal is the default choice.

SHCUT-NAME

This field specified the name of the shortcut as it will appear on the desktop or in Explorer. Do not put an extension.

SHCUT-LOCATION

This is the directory in which the shortcut will be located.  If you leave it low values it will default to the desktop.  You may specify any other standard directory or use GetFolderPath API to find special directories such as My Documents or StartUP directory, the position of which varies by what operating system is in use and who is logged on.

SHCUT-WORKING-DIR

Enter the working directory for this application if necessary.  Typically this is NOT necessary, unless your application expects to find itself located in a specific directory upon start up.

SHCUT-TARGET

This field holds the exact path specification (Drive, directory, filename and extension) of the application or file that you wish to launch.  If this points to an EXE that program will launch when the link is clicked. If it points to another type of file such as a doc or jpg, the system will launch the default application for that file type.  It may be wise to use the \\servername\directoryname\file.ext format if you create icons to programs that reside on a file server.  This avoids drive mapping problems.

SHCUT-COMMAND-ARGS

If you are launching a program, you can feed it any command line arguments in this field.  Format is as you would type them if you did so at the command prompt.

SHCUT-ICON

You may specify a file name and index number for the Icon shown in explorer and on the desktop.   If you do not specify an icon, the default Icon from that .EXE will be used.  If the Target is not and EXE, the Icon will be selected from the default application that handles that type of file or URLl.  Index number is the order in which Icons are shown if you right click a shortcut and select Change Icon.

 

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom