Results 1 to 4 of 4

Thread: Shortcuts?

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Question

    Anyone know how to create a shortcut with VB?
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    According to Developer Code Book

    Code:
    'Compatibility: VB 5,VB 4/32
    
    'Task: Create a shortcut in Windows on the desktop and on the start menu
    
    'Declarations
    'NOTE: In Visual Basic 5.0, change Stkit432.dll in the following
    'statement to Vb5stkit.dll. Stkit432.dll is for Visual Basic 4.0
    
    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
    
    
    'Code:
    Dim lReturn As Long
    
    'Add to Desktop
    lReturn = fCreateShellLink("..\..\Desktop", _
    "Shortcut to Calculator", "c:\windows\calc.exe", "")
    
    'Add to Program Menu Group
    lReturn = fCreateShellLink("", "Shortcut to Calculator", _
    "c:\windows\calc.exe", "")
    
    'Add to Startup Group
    'Note that on Windows NT, the shortcut will not actually appear
    'in the Startup group until your next reboot.
    lReturn = fCreateShellLink("\Startup", "Shortcut to Calculator", _
    "c:\windows\calc.exe", "")

  3. #3

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    Hmm...
    Now if I can just figure out how to do that with a DUN.
    For some stupid reason windows won't give DUN's a filepath.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  4. #4

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    Nevermind, I found a way around it
    I'll just make a copy of the shortcut I have on my comp, the DUN will have the same name and it will all work out fine.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

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