Hi all
Cheng Wei has (almost) answered all of my
queries accept as below.
I have to bore you with this as I cannot
seem to contact him directly ([EMAIL PROTECTED])
Cheng
Thanks very much for replying to me
request yesterday for help. The program now nearly compiles but
I am now getting the following error(s).
Using the 'Concat' function instead of
concatenating the string using + '/'
+
doesn't help.
I don't want to change anything that
presumably worked for you. Did you ever have the
code working as
shown or is it a case of "should work"
?
procedure TForm1.CreateShortCutOnDesktop(var
sExeName,sDirPath
:string);
{ Parameters :- sExeName = Program name and sDirPath = Directory Path } var tmpObject :
Unknown;
tmpSLink : ShellLink; tmpPFile : PersistFile; PIDL : PItemIDList; ShortCutDirectory : array[0..255] of char; ShortCutFileName : WideString; begin { Create a COM object, initialise to ShellLink interface} tmpObject := createComObject(CLSID_ShellLink); tmpSLink := tmpObject as IShellLink; tmpPFile := tmpObject as IPersistFile; { Create Shortcut ICON on the
Desktop}
tmpSLink.SetPath(pChar(sExeName)); tmpSLink.SetWorkingDirectory(pChar(sDirPath));
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,PIDL);
SHGetPathFromIDList(PIDL,ShortCutDirectory); { Error here -------------------
{--->
ShortCutFileName := ShortCutDirectory + '\' + { produces
an"Incompatible types" error}
{ If I comment out the " + '\' " code then the
"Incompatibe types" error is fixed but the
following part of the line produces an
error "not enough actual parameters", (which may
be caused by the missing "\" of course) }
ChangeFileExt(ExtractFileName(sEXEName)),'lnk'; -------------------------------}
tmpPFile.Save(pWChar(ShortcutFileName),
FALSE;
end; The program will not compile as shown for the line
marked {--->
Sorry to bother you, I'm a bit out of my
depth with this, but so very nearly there with what I want.
Cheers
Colin
|
- RE: [DUG]: Creating desktop shortcut Colin Dillicar
- RE: [DUG]: Creating desktop shortcut Cheng Wei
- RE: [DUG]: Creating desktop shortcut Myles Penlington