By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

Shortcuts

Ali Rizwan
100+
P: 927
Hi,
How can we make shortcuts using vb6.
Actually i m making setup for my app and want to make shortcuts to dektop and startmenu.
How can i do this.
Thanx
Sep 24 '07 #1
Share this Question
Share on Google+
6 Replies


hariharanmca
100+
P: 1,977
You have to do many things for that (thats like an assignment.)
you have to try and i will point you in correct direction.
Sep 24 '07 #2

Expert 5K+
P: 8,434
You're probably better off getting a real installation creator, such as InstallShield.
Sep 24 '07 #3

Ali Rizwan
100+
P: 927
You're probably better off getting a real installation creator, such as InstallShield.
Thanx
But how can i get such thing.
Is it a software and available on CDs
Sep 24 '07 #4

Ali Rizwan
100+
P: 927
You have to do many things for that (thats like an assignment.)
you have to try and i will point you in correct direction.
Thanx
But i m creating my own setup first time.
And doesnot know about creating shortcuts.
Sep 24 '07 #5

Ali Rizwan
100+
P: 927
You're probably better off getting a real installation creator, such as InstallShield.
And i ll thank you a lot if you send me an example.
Thanx
Sep 24 '07 #6

hariharanmca
100+
P: 1,977
Below are the Decleration part
Expand|Select|Wrap|Line Numbers
  1. ' Folder used to physically store file objects on the desktop.
  2. Const CSIDL_DESKTOPDIRECTORY = &H10
  3.  
  4. Private Type SHITEMID
  5.     cb   As Long
  6.     abID As Byte
  7. End Type
  8.  
  9. Private Type ITEMIDLIST
  10.     mkid As SHITEMID
  11. End Type
  12.  
  13. Const MAX_PATH As Integer = 260
  14.  
  15. ' Retrieves the ID of a special folder.
  16. Private Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" _
  17.     (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
  18.  
  19. ' Converts an item identifier list to a file system path.
  20. Private Declare Function SHGetPathFromIDList Lib "Shell32.dll" _
  21.     Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
  22.     ByVal pszPath As String) As Long
  23.  
  24. Dim strDestopPath As String
  25.  
The below code will return you the present destop Path
Expand|Select|Wrap|Line Numbers
  1. Private Function fGetSpecialFolder(CSIDL As Long) As String
  2. Dim sPath As String
  3. Dim IDL   As ITEMIDLIST
  4. ' Retrieve info about system folders such as the
  5. ' "Recent Documents" folder.  Info is stored in
  6. ' the IDL structure.
  7. If SHGetSpecialFolderLocation(Me.hwnd, CSIDL, IDL) = 0 Then
  8.     sPath = Space$(MAX_PATH)
  9.     If SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal sPath) Then
  10.         fGetSpecialFolder = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\"
  11.     End If
  12. End If
  13. End Function
Calling the above method.
Expand|Select|Wrap|Line Numbers
  1. strDestopPath = fGetSpecialFolder(CSIDL_DESKTOPDIRECTORY)
Now you try to place the shortcut here.
Sep 24 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.