Вниз
Скачать: 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.025 c
3-1090493501
Phoenix
2004-07-22 14:51
2004.08.15
ClientDataSet и контекстный поиск


9-1083143091
xman
2004-04-28 13:04
2004.08.15
гравитация в космосе


1-1091185086
Jiurasrdfy
2004-07-30 14:58
2004.08.15
Как увелиичть скорость компиляции программы?


1-1091514916
Arte123
2004-08-03 10:35
2004.08.15
Как узнать количество child у конкретного TTreeNode в TTreeView?


6-1087452695
anton.
2004-06-17 10:11
2004.08.15
Как создать TCPServer в Runtime?




   Наверх