Re: Create a shortcut in SendTo menu
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Fri, 9 Dec 2005 19:40:58 -0500
I can't agree at all with your recommendation. Under NO circumstances
whatsoever would I want my app dependent on VB's Setup Toolkit DLL. And the
one you're mentioning is from VB4 (although it should work in a VB5/6 app).
A MUCH better alternative is to use the IShellLink interface. There's an
unsupported example program included with VB that shows how to use it. It
includes a type library that exposes the interface for use in VB. There are
no dependencies and nothing extra to distribute (because the interface is
part of Windows; you just need the type library to expose the interface
within the VB IDE). Plus, you have so much more functionality than what
fCreateShellLink offers. For example, you can create the shortcut anywhere
you want (fCreateShellLink can only create shortcuts in specific folders off
the Start Menu [granted, you can specify a path relative to the Start
Menu\Programs folder, but that gets messy]). You can also edit an existing
shortcut or just get any of the shortcut's properties if you just need to
know what they are.
Look on your VB CDs. Which CD depends on whether you have VB or VS and
which edition you have. I believe the example is only included with the
Pro/Ent editions, though. The project file name you're looking for is
"SHELLLNK.VBP" and should be in a folder similar to
"M:\COMMON\TOOLS\VB\UNSUPPRT\SHELLLNK". Now, I have VS Ent and this folder
is on disc 3. As I said, where you'll find it will vary, so the easiest way
is to just search via Windows Explorer for the project file name.
Eduardo Morcillo also has a type library that exposes the IShellLink
interface that you could use instead. It can be downloaded fromr here:
http://www.mvps.org/emorcillo/en/code/vb6/index.shtml
(it's the OLELIB.TLB file; GREAT file to have by the way since it exposes a
LOT of functionality to VB)
For documentation on the IShellLink interface, consult MSDN Library:
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishelllink/ishelllink.asp
--
Mike
Microsoft MVP Visual Basic
"Ted" <2000@xxxxxxxxxx> wrote in message
news:%23l4qn8Q$FHA.740@xxxxxxxxxxxxxxxxxxxxxxx
> Never had a problem distributing or running STKIT432.DLL, there
> is only two versions released, it is a must have.
>
> "arno" <rNOSPAMnospam@xxxxxxxxx> wrote in message
> news:3c0kp1dvl9u3ktkuah5a237ucdl3rmbvm4@xxxxxxxxxx
>> Okay, that requires a dependency on a file. I'd rather not have to do
>> that; it is a sure way of getting into trouble when distributing the
>> app. Given a choice, I'd rather stick with a dependency on the WSH.
>>
>> Tx for your input, tho, it was very useful,
>> arno
>>
>> On Fri, 9 Dec 2005 13:49:45 -0800, "Ted" <2000@xxxxxxxxxx> wrote:
>>
>>>You need to distribute STKIT432.DLL with your app.
>>>
>>>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
.
- Follow-Ups:
- Re: Create a shortcut in SendTo menu
- From: mayayana
- Re: Create a shortcut in SendTo menu
- References:
- Create a shortcut in SendTo menu
- From: arno
- Re: Create a shortcut in SendTo menu
- From: arno
- Re: Create a shortcut in SendTo menu
- From: arno
- Create a shortcut in SendTo menu
- Prev by Date: Re: Snowfall screensaver
- Next by Date: Re: text files
- Previous by thread: Re: Create a shortcut in SendTo menu
- Next by thread: Re: Create a shortcut in SendTo menu
- Index(es):
Relevant Pages
|