Article View: comp.lang.basic.misc
Article #138Re: Shortcut
From: Johan Bechthum
Date: Sat, 05 Aug 2000 00:00
Date: Sat, 05 Aug 2000 00:00
104 lines
3573 bytes
3573 bytes
Nico,
Some time ago someone asked a similar question.
I saved the code of the reply for later use.
I hope it works for you.
Johan
===========================
'This example uses a TextBox 'txtDDE'
Option Explicit
Private Declare Function GetShortPathName Lib "kernel32" Alias
"GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As
String, ByVal cchBuffer As Long) As Long
Public Sub AddShortcutToStartup()
Dim szPath As String
Dim szIconPath As String
Dim lLength As Long
Dim szHide As String
szPath = GetPath(App.Path, App.EXEName) & ".exe"
szIconPath = Space(300)
lLength = GetShortPathName(szPath, szIconPath, 299)
szIconPath = Left(szIconPath, lLength)
OpenDDE
txtDDE.LinkExecute "[ShowGroup(""StartUP"",1)]"
txtDDE.LinkExecute "[AddItem(""" & szPath & """" & ",""NoteKeeper"","""
& szIconPath & """,0)]"
CloseDDE
End Sub
Public Sub RemoveShortcutFromStartup()
OpenDDE
txtDDE.LinkExecute "[ShowGroup(""StartUP"",1)]"
txtDDE.LinkExecute "[DeleteItem(""NoteKeeper"")]"
CloseDDE
End Sub
Public Sub AddGroup()
Dim szPath As String
Dim szIconPath As String
Dim lLength As Long
szPath = GetPath(App.Path, App.EXEName) & ".exe"
szIconPath = Space(300)
lLength = GetShortPathName(szPath, szIconPath, 299)
szIconPath = Left(szIconPath, lLength)
OpenDDE
txtDDE.LinkExecute "[CreateGroup(""NoteKeeper"")]"
txtDDE.LinkExecute "[AddItem(""" & szPath & """" & ",""NoteKeeper"","""
& szIconPath & """,2)]"
CloseDDE
End Sub
Public Sub RemoveGroup()
OpenDDE
txtDDE.LinkExecute "[ShowGroup(""NoteKeeper"",1)]"
txtDDE.LinkExecute "[DeleteGroup(""NoteKeeper"",1)]"
CloseDDE
End Sub
Private Sub OpenDDE()
txtDDE.LinkTopic = "PROGMAN|PROGMAN"
txtDDE.LinkMode = vbLinkManual
End Sub
Private Sub CloseDDE()
txtDDE.LinkMode = vbLinkNone
End Sub
Public Function GetPath(szPath As String, szFile As String) As String
If Len(szPath) > 3 Then
GetPath = szPath & "\" & szFile
Else
GetPath = szPath & szFile
End If
End Function
===========================
"Nico Berg" <news@berg.nl.com> schreef in bericht
news:XuIi5.8837$Gd1.74459@Typhoon.bART.nl...
> Hi all,
>
> I need to make a shortcut in the program section of win98. How can i do
> that?
>
> I have found some code on http://www.vbexplorer.com/tips/src06.htm but
this
> code does not give the "begin in" or "start in" folder, only the cmdline
and
> not the defdir. It does work in 2000.
>
> Does somebody know's a url with a samplecode or does anybody has the
> solution?
>
> Greetings, Nico Berg
>
>
Technical Details
Message-ID:
<6__i5.5602$63.125774@zonnet-reader-1>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<XuIi5.8837$Gd1.74459@Typhoon.bART.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c949,87f3ed70e3888cdc X-Google-Attributes: gid10c949,public X-Google-Thread: 108062,87f3ed70e3888cdc X-Google-Attributes: gid108062,public X-Google-Thread: 110e3b,87f3ed70e3888cdc X-Google-Attributes: gid110e3b,public From: "Johan Bechthum" <JohanBechthum@zonnet.nl> Subject: Re: Shortcut Date: 2000/08/05 Message-ID: <6__i5.5602$63.125774@zonnet-reader-1> X-Deja-AN: 654863201 References: <XuIi5.8837$Gd1.74459@Typhoon.bART.nl> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Complaints-To: abuse@zonnet.nl X-Trace: zonnet-reader-1 965508098 212.189.204.239 (Sat, 05 Aug 2000 22:41:38 MET DST) X-MSMail-Priority: Normal NNTP-Posting-Date: Sat, 05 Aug 2000 22:41:38 MET DST Newsgroups: comp.lang.basic.misc,comp.lang.basic.visual.misc,cz.comp.lang.basic.visual