Results 1 to 2 of 2

Thread: Adding shortcuts to Start Menu

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Post

    I'm working on a Setup program for my program, an d i need to add shortcuts to my program in the start menu, just like the Vb installer does.
    How do i do that???



    ------------------
    Yours sincierly
    CyberCarsten
    http://home18.inet.tele.dk/cyber/
    [email protected]

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    Pop this in the code (this is for VB5 - it may be different for VB6)

    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

    Sub CreateShortcut(Location As String, linkname As String, linkpath As String, linkargs As String)
    'location = path from [programs folder] on start menu. eg, ..\..\desktop = desktop
    Dim lngResult As Long
    lngResult = fCreateShellLink(Location, linkname, linkpath, linkargs)
    End Sub

    then call it by using

    CreateShortCut [location],[name],[path],[arguments]

    where [location] is the location you want to place the shortcut - note that the root of this is always the PROGRAMS menu on the START menu. Therefore, if you want to create the link on the desktop you must use "..\..\Desktop" (for Win'95) etc

    [name] is the name you want to display on the icon,
    [path] is the path to the file you are building a shortcut for
    [arguments] are any arguments you want to put on the shortcut.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width