🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.basic.misc
2 messages
2 total messages Started by Nico Berg Fri, 04 Aug 2000 00:00
Shortcut
#137
Author: Nico Berg
Date: Fri, 04 Aug 2000 00:00
13 lines
1205 bytes
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
Re: Shortcut
#138
Author: Johan Bechthum
Date: Sat, 05 Aug 2000 00:00
104 lines
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
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads