Masaüstüne Programınızın Kısyolunu Oluşturmak | Delphi
#1
Delphi
  1. uses ShlObj, ActiveX, ComObj;
  2. ...
  3. procedure TForm1.Button1Click(Sender: TObject) ;
  4. var
  5. IObject : IUnknown;
  6. ISLink : IShellLink;
  7. IPFile : IPersistFile;
  8. PIDL : PItemIDList;
  9. InFolder : array[0..MAX_PATH] of Char;
  10. TargetName : String;
  11. LinkName : WideString;
  12. begin
  13. TargetName := 'c:\windows\calc.exe';
  14.  
  15. {Use TargetName:=ParamStr(0) which
  16.   returns the path and file name of the
  17.   executing program to create a link to your
  18.   Application}
  19.  
  20. IObject := CreateComObject(CLSID_ShellLink) ;
  21. ISLink := IObject as IShellLink;
  22. IPFile := IObject as IPersistFile;
  23.  
  24. with ISLink do
  25. begin
  26. SetPath(pChar(TargetName)) ;
  27. SetWorkingDirectory(pChar(ExtractFilePath(TargetName))) ;
  28. end;
  29.  
  30. // if we want to place a link on the Desktop
  31. SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL) ;
  32. SHGetPathFromIDList(PIDL, InFolder) ;
  33.  
  34. {
  35.   or if we want a link to appear in
  36.   some other, not-so-special, folder:
  37.   InFolder := 'c:\SomeFolder'
  38.   }
  39.  
  40. LinkName := InFolder + '\Delphi Created Link.lnk';
  41. IPFile.Save(PWChar(LinkName), false) ;
  42. end;



Alıntıdır..



  Alıntı
Bu mesajı beğenenler:


Benzer Konular...
Konu: Yazar Cevaplar: Gösterim: Son Mesaj
  Delphi ile Lokanta Takip Uygulaması (MSSQL tabanlı) d_rago_n 10 13.756 11-07-2020, 17:48
Son Mesaj: hsyn35
  Delphi de arama yapma Saittt 0 2.405 18-12-2016, 04:51
Son Mesaj: Saittt
  Otel otomasyonu Delphi Saittt 0 2.664 18-12-2016, 04:43
Son Mesaj: Saittt
  Delphi dilinde yazılmış Hastane Takip Programı (Access veritabanlı) d_rago_n 15 17.692 14-08-2015, 00:08
Son Mesaj: selchuk
  Delphi'de Veri Tabanı Uygulamaları | Görsel Anlatım şahrapçi 2 10.526 21-01-2015, 10:06
Son Mesaj: mdelioglu
  DELPHI (E-KİTAP) Ç@kıL 3 6.555 05-12-2014, 17:26
Son Mesaj: omerr
access-sql-18 Delphi ile SQL le resim ekleme bensahin 0 5.172 17-07-2014, 11:46
Son Mesaj: bensahin
  Delphi 7.0 Türkçe | Görsel Eğitim Seti şahrapçi 12 12.082 01-06-2013, 23:03
Son Mesaj: muzaffer.sm

Foruma Git:


Bu konuyu görüntüleyen kullanıcı(lar): 1 Ziyaretçi