Вниз
Скачать: CL | DM;

как програмно создать ярлык?   Найти похожие ветки 

← →
syte_ser78 ©   (2004-07-26 09:39) [0]

сабж


← →
clickmaker ©   (2004-07-26 10:32) [1]

procedure CreateFileLink(const FileName, DisplayName: string; Folder: Integer);
var
 ShellLink: IShellLink;
 PersistFile: IPersistFile;
 ItemIDList: PItemIDList;
 FileDestPath: array[0..MAX_PATH] of Char;
 FileNameW: array[0..MAX_PATH] of WideChar;
begin
 CoInitialize(nil);
 try
   OleCheck(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_SERVER,
     IID_IShellLinkA, ShellLink));
   try
     OleCheck(ShellLink.QueryInterface(IID_IPersistFile, PersistFile));
     try
       OleCheck(SHGetSpecialFolderLocation(0, Folder, ItemIDList));
       SHGetPathFromIDList(ItemIDList, FileDestPath);
       StrCat(FileDestPath, PChar("\" + DisplayName + LinkExt));
       ShellLink.SetPath(PChar(FileName));
       ShellLink.SetIconLocation(PChar(FileName), 0);
       MultiByteToWideChar(CP_ACP, 0, FileDestPath, -1, FileNameW, MAX_PATH);
       OleCheck(PersistFile.Save(FileNameW, True));
     finally
       PersistFile := nil;
     end;
   finally
     ShellLink := nil;
   end;
 finally
   CoUninitialize;
 end;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.033 c
3-1090415587
VadimKV
2004-07-21 17:13
2004.08.15
Создание Домена(Domain) програмно в FB1.5.


14-1091127173
wl
2004-07-29 22:52
2004.08.15
Написание компилятора


10-1028123224
LeS
2002-07-31 17:46
2004.08.15
ERROR "Сбой при удалённом вызове процедуры"


14-1091007716
Дима
2004-07-28 13:41
2004.08.15
Книги по Delphi 7


10-1029155899
aserov
2002-08-12 16:38
2004.08.15
Проблема с COM




   Наверх