I use OSfCreateShellLink in my VB program to create icons link in Start>Programs and in immediate subfolders.
fSuccess = OSfCreateShellLink(strGroupName, strLinkName, strLinkPath, strLinkArguments, fPrivate, sParent)
It works fine on Windows 2000 and XP; all the icons get created fine.
But I cannot get it to work on Windows ME.
Do I have to pass the values differently for Windows ME?
Is there anything else I have to use to create icons (lnk) on ME? (on ME I can create the Start Program subfolders but not the icons).
On Windows ME the function OSfCreateShellLink does not even seem to return a fSuccess value but seems to go right into error. That is why I am asking if I should pass the values differently for Windows ME?
Any help is welcomed.
FYI:
'-----------------------------------------------------------
' SUB: CreateShellLink
'
' Creates (or replaces) a link in either Start>Programs or
' any of its immediate subfolders in the Windows 95 shell.
'
' IN: [strLinkPath] - full path to the target of the link
' Ex: 'c:\Program Files\My Application\MyApp.exe"
' [strLinkArguments] - command-line arguments for the link
' Ex: '-f -c "c:\Program Files\My Application\MyApp.dat" -q'
' [strLinkName] - text caption for the link
' [fLog] - Whether or not to write to the logfile (default
' is true if missing)
'
' OUT:
' The link will be created in the folder strGroupName
'-----------------------------------------------------------
Public Declare Function OSfCreateShellLink Lib "vb6stkit.dll" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String, ByVal fPrivate As Long, ByVal sParent As String) As Long
Dominique G. Schneider
fSuccess = OSfCreateShellLink(strGroupName, strLinkName, strLinkPath, strLinkArguments, fPrivate, sParent)
It works fine on Windows 2000 and XP; all the icons get created fine.
But I cannot get it to work on Windows ME.
Do I have to pass the values differently for Windows ME?
Is there anything else I have to use to create icons (lnk) on ME? (on ME I can create the Start Program subfolders but not the icons).
On Windows ME the function OSfCreateShellLink does not even seem to return a fSuccess value but seems to go right into error. That is why I am asking if I should pass the values differently for Windows ME?
Any help is welcomed.
FYI:
'-----------------------------------------------------------
' SUB: CreateShellLink
'
' Creates (or replaces) a link in either Start>Programs or
' any of its immediate subfolders in the Windows 95 shell.
'
' IN: [strLinkPath] - full path to the target of the link
' Ex: 'c:\Program Files\My Application\MyApp.exe"
' [strLinkArguments] - command-line arguments for the link
' Ex: '-f -c "c:\Program Files\My Application\MyApp.dat" -q'
' [strLinkName] - text caption for the link
' [fLog] - Whether or not to write to the logfile (default
' is true if missing)
'
' OUT:
' The link will be created in the folder strGroupName
'-----------------------------------------------------------
Public Declare Function OSfCreateShellLink Lib "vb6stkit.dll" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String, ByVal fPrivate As Long, ByVal sParent As String) As Long
Dominique G. Schneider