//*******************************************************
//*       TShortcutLink Component for Delphi 2.0        *
//*       by Elliott Shevin, Oak Park, Mich. USA        *
//*       May, 1999                                     *
//*       email: shevine@aol.com                        *
//*                                                     *
//*       A component for extracting information from,  *
//*       and creating, shortcut files.                 *
//*                                                     *
//*       Although the component contains conditional   *
//*       code for Delphi 3.0 and up, I must warn you   *
//*       that I work with Delphi 2, and haven't tried  * 
//*       it. However, Jordan Russell was kind enough   *
//*       to review the code for Delphi 3, so I'm       *
//*       confident you should have no problems.        *
//*                                                     *
//*       This component is freeware. Use it in good    *
//*       health, no restrictions, but please           *
//*       acknowledge me and these two gentlemen        *
//*       whose code was raided to make this component  *
//*       possible:                                     *
//*           Radek Voltr, whose TShellLink component   *
//*		 provided the means of reading shortcut *
//*        	 files;                                 *
//*	      Jordan Russell, whose Inno Setup program  *
//*              showed how to write them.              *		
//*                                                     *
//*******************************************************

Just install the component as you usually do. As written,
it installs to the Win95 tab of the component palette.

The ShlObj file contained in this package is a version containing 
corrections from Brad Stowers. If your Delphi package is the same 
as mine, you don't even have a ShlObj file, and can use this one. 
Other Delphi 2 installations have a faulty ShlObj file, which
this one corrects. If you have a MyShlObj.pas file downloaded
with some other component set, it's the same thing; you can 
change the reference to ShlObj here to MyShlObj before installing.
Users of Delphi 3 and later won't need to worry about this at all.

If the install runs clean with the ShlObj you already have, by 
all means don't fix what's not broken.

Herewith, a description of TShortcutLink's properties and methods:

Published properties:
    ShortcutFile  : (string) the shortcut file itself, complete with 
                    path; you're responsible for ensuring the 
                    extension is .LNK .
    Target        : (string) the file the shortcut points to.
    WorkingDir    : (string) working directory property of the shortcut.
    Description   : (string) description property of the shortcut. 
    Arguments     : (string) arguments property of the shortcut. 
    IconLocation  : (string) file containing the shortcut's icon; 
                    if the target is your program, this would be the 
                    program itself (and identical to the target 
                    property).
    IconNumber    : (word) relative icon number within the 
                    IconLocation file; 0 is the first icon, etc.
    HotKey        : (string) a single character which, with 
                    Ctrl + Alt, becomes the hot key for invoking 
                    the shortcut; leaving this blank signifies 
                    there is no hot key.
    ShowCmd       : (enumerated) the state of the window when the 
                    target is opened; possible values are 
                    scShowMaximized, scShowMinimized, and scShowNormal.

Methods:
    Read          : Extracts the remaining published properties from the 
                    shortcut file named in the ShortcutFile property.
    Write         : Creates or replaces the shortcut file named 
                    in ShortcutFile with one having the properties 
                    contained in the other published properties. That 
                    is, you set all the published properties and then 
                    use the Write method to create the shortcut.
    DesktopFolder,
    ProgramsFolder,
    StartFolder,
    StartupFolder  : four string functions which return the directories 
                     corresponding to these four locations, respectively:
                         the Desktop, 
                         the Programs folder on the Start menu, 
                         the Start menu itself, 
                         the Startup folder on the Start menu.
                     The directory names come without the final backslash.
       For example, to put your link file on the Start menu, you
       can code:
             ShortcutLink1.ShortcutFile 
                   := ShortcutLink1.StartFolder + '\My Shortcut.lnk';
             ... {set remaining properties here}
             ShortcutLink1.write;

Exception:
    EShortcutError.


I'll be happy to hear your comments and suggestions at: shevine@aol.com.