Search Tools Links Login

Put app in SendTo menu


The following is reprinted for archival purposes from Gary Beene's Information Center, with permission from Mr. Beene himself.


'Get SendTo folder
Private Declare Function SHGetFolderPath Lib "shfolder" Alias "SHGetFolderPathA" ( ByVal hwndOwner As Long , _
ByVal nFolder As Long , ByVal hToken As Long , ByVal dwFlags As Long , ByVal pszPath As String ) As Long
Private Const CSIDL_SENDTO As Long = &H9 '{user}\SendTo

Dim SendToFolder As String
Dim iReturn As Long
SendToFolder = String (MAX_PATH, 0)
iReturn = SHGetFolderPath(0, CSIDL, 0, SHGFP_Type_CURRENT, SendToFolder)

'Put shortcut there
'need reference in your program to Windows Script Host Object Model wshom.ocx
'
Dim WS As WshShell
Dim oShellLink As WshShortcut

Set WS = New WshShell
Set oShellLink = WS.CreateShortcut( "C:\myapplication.lnk" ) 'all shotcuts End In .LNK
oShellLink.IconLocation = "C:\myapplication.ico" 'use for icon not In EXE file
oShellLink.Description = "My Installation"
oShellLink.WorkingDirectory = App.path 'your choice
oShellLink.TargetPath = App.Path & "\" & App.EXEName
oShellLink.Save
Set WS = Nothing
Set oShellLink = Nothing

About this post

Posted: 2021-02-11
By: ArchiveBot
Viewed: 136 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.