Re: Createing shortcuts using VB6

From: MikeD (nobody_at_nowhere.edu)
Date: 07/25/04


Date: Sun, 25 Jul 2004 09:40:54 -0400


"Colin Bruce" <cb@sidney-road.free_nospam_serve.co.uk> wrote in message
news:cdvums$mg6$1@titan.btinternet.com...
> Thanks to all of you for your replies (and sorry for my spelling of
> creating!).
>
> I am looking for this code to work in VB and VBA so I need a method
without
> adding external components.
>
> I went to AllAPI and their fCreateShellLink demo includes a call to
> 'vb6stkit.dll'. I cannot find any info on what versions of Windows this
is
> included with.
>
> The word version of this code could be on NT4, 2000, XP and possibly ME.
I
> know it is included in 2000 and XP, does anyone know about other versions
of
> Windows?
>

The Shelllnk example does not require any DLLs or OCX. You merely add a
type library which exposes the IShellLink interface. You should be able to
use it in VBA as well as VB (although I've never used it myself in VBA).

Using vb6stkit.dll would NOT be advisable for a number of reasons. First,
there's the dependency. To my knowledge, no version of Windows
automatically includes this file. It's part of the Setup Toolkit used by
VB6's Package and Deployment Wizard. It would only exist if a VB6 app were
installed by a PDW-created setup....and even then, I'd personally never rely
on it being present. Second, the function it exports for creating lnk files
is extremely limited. It is designed to create shortcuts in either "\Start
Menu\Programs" or a subfolder of that. You can specify a path relative to
"\Start Menu\Programs", but this could get difficult to do. Third, you
cannot modify an existing shortcut.

The Shelllnk type library has none of these drawbacks.

Mike



Relevant Pages

  • Re: PROBE-FILE and Windows shortcuts
    ... That would make it possible to use ASDF on Windows as it was ... by creating shortcuts to .asd files in ... Windows shortcut .lnk files are more closely analogous to ... clisp is likely just using that support, ...
    (comp.lang.lisp)
  • Re: all exe files switched to .lnk file type??
    ... to start Windows at all. ... Shortcuts actually have the extension .lnk - but this is usually hidden by ... It could be that the associations for .lnk files have been messed up. ... Search on Google for "lnk association". ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: PROBE-FILE and Windows shortcuts
    ... That would make it possible to use ASDF on Windows as it was ... by creating shortcuts to .asd files in ... Cygiwn, however, uses special augmented shortcut .lnk files to represent ... clisp is likely just using that support, and "alien to cygwin" (i.e. ...
    (comp.lang.lisp)
  • Re: Createing shortcuts using VB6
    ... The shelllnk.tlb isn't included in Windows either or is it? ... I take Microsoft has no issues with the redistribution of their example ... > use it in VBA as well as VB. ... It is designed to create shortcuts in either "\Start ...
    (microsoft.public.vb.general.discussion)
  • Lost Shortcuts
    ... start menu shortcuts were replaced with .lnk files that ... Windows does not know how to use. ... prompts me to select an appropriate program. ... get my shortcuts back? ...
    (microsoft.public.windowsxp.general)

Loading