Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shortcut

Status
Not open for further replies.

mg911

Technical User
Jul 18, 2001
59
US
is there a way in basic - to create a shortcut to appear on the desktop -

or is there a way to create a shortcut and name it, and tell it the location

or is there a way i could just copy an icon to the desktop

1 of the 3 will be fine - i just need to know how to get a icon to the desktop

Thanks


 
does that work with 2000 and even NT

i know it will work with 95/98

because there is the directory C:\windows\desktop
but with 2000/NT there is c:\doc&setting\admin\desktop

or is there a way to make it universal

thank you for you help

it has been VERY helpful
 
Hmmm.... [tt]SHGetSpecialFolderLocation[/tt] works with 9x and NT. Should work with 2000 (haven't tried it). You might be able to use the following code and retrieve the location of the DeskTop folder with:[tt] GetSpecialfolder(0)[/tt].
Code:
Private Type SHITEMID
    cb As Long
    abID As Byte
End Type
Private Type ITEMIDLIST
    mkid As SHITEMID
End Type
Private Declare Function SHGetSpecialFolderLocation _
    Lib "shell32.dll" _
    (ByVal hwndOwner As Long, _
    ByVal nFolder As Long, _
    pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList _
    Lib "shell32.dll" _
    Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
    ByVal pszPath As String) As Long
    
Private Function GetSpecialfolder(CSIDL As Long) As String
    Dim r As Long
    Dim IDL As ITEMIDLIST
    r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
    If r = NOERROR Then
        Path$ = Space$(512)
        r = SHGetPathFromIDList(ByVal IDL.mkid.cb, _ 
           ByVal Path$)
        GetSpecialfolder = Left$(Path, _ 
           InStr(Path, Chr$(0)) - 1)
        Exit Function
    End If
    GetSpecialfolder = ""
End Function
Unfortunately, I know of no convenient way to do this from a batch file or the earlier versions of BASIC.

You are planning to code this in VB... yes? :)
VCA.gif
 
well either VB or Basic -
i thought basic would be the easiest of the two -

but i have been know to be incorrect -
if it is possible to do it in basic that would be nice but this is not a perfect world -

thanks again for the help
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top