Arsip: Create Application's ShortCut


by yayaretina in TipDanTrik more 11 years ago 962

tanpa banyak kata..

intinya membaut shortcut di desktop aplikasi yang kita buat..    


uses ShlObj, ShellApi..

procedure CreateShortCut(Source : String);
var
IObject : IUnknown;
ISLink : IShellLink;
IPFile : IPersistFile;
PIDL : PItemIDList; InFolder :
array[0..MAX_PATH] of Char;
TargetName : String;
LinkName : WideString;
begin
TargetName := Source;
IObject := CreateComObject(CLSID_ShellLink) ;
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile;
with ISLink do begin
SetPath(pChar(TargetName)) ;
SetWorkingDirectory(pChar(ExtractFilePath(TargetName))) ;
end;
SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL) ;
SHGetPathFromIDList(PIDL, InFolder) ;
LinkName := InFolder + '\Test ShortCut.lnk';
IPFile.Save(PWChar(LinkName), false) ;
end;


Silahkan dicoba dulu, klo belom bisa silahkan komplain ke google ..
xixixixiii...

  
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com