ATTENTION READERS! Lucky's VB Gaming Site is no longer active. For updated game programming information and tutorials, please visit The Game Programming Wiki!
Adding Shortcuts in Windows 98
If you would like to add a shortcut to your program in the Start Menu, you can use the undocumented API call, fCreateShellLink, that is used in the setupkit.
Declarations
Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
If you are using Windows 95 then the following API is used:
Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName as String, ByVal lpstrLinkName as String, ByVal lpstrLinkPath as String, ByVal lpstrLinkArgs as String) As Long
Use
To add a shortcut to the Start Menu, you call the function with these parameters:
lpstrFolderName = Where to place the link in relation to the Programs folder on the Start Menu
lpstrLinkName = Name or Text to appear in the link
lpstrLinkPath = Path of the file to link to
lpstrLinkArgs = Arguments for the file
For instance, to add a shortcut to the desktop, you would use the following code:
Dim lngResult As Long
Call lngResult = fCreateShellLink("..\..\Desktop", "Link to my program", "C:\Path\Program.exe","")