Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.08.26;
Скачать: CL | DM;

Вниз

Информация из *.lnk файла. (any Delphi)   Найти похожие ветки 

 
MikeZ   (2002-06-22 23:10) [0]

Привет. Есть LINK-файл (*.lnk). Надо получить из него полное имя файла и, очень желательно, все остальные характеристики. Приведите пример кода, please. Есть 2 способа - с помощью ShlObj и через структуру файла. Можно любым способом. Спасибо.


 
Proton ©   (2002-06-23 04:00) [1]

Хош полную прогу на мыло скину ?
она создает quick lanch на основе папки с ярлыками

Function GetLinkParams(LinkFile:string;var IcoIndex:integer;var ShowCmd:DWORD;
var Path,Params,WorkDir,Description,IconPath:string):boolean;
var
WideFile : WideString;
buf : array[1..1024] of char;
i:integer;
fd : TWin32FindData;
begin
result := false;
DefObject := CreateComObject(CLSID_ShellLink);
DefSLink := DefObject as IShellLink;
DefPFile := DefObject as IPersistFile;
WideFile := LinkFile;
if DefPFile.Load(pwchar(WideFile),0) = S_OK then
with DefSLink do
begin
if GetDescription(@buf,sizeof(buf)) = NOERROR then
Description := copy(buf,1,lstrlen(@buf)) else Description := "";
if GetArguments(@buf,sizeof(buf)) = NOERROR then
Params := copy(buf,1,lstrlen(@buf)) else Params := "";
if GetPath(@buf,sizeof(buf),fd,0) = NOERROR then
Path := copy(buf,1,lstrlen(@buf)) else Path := "";
if GetWorkingDirectory(@buf,sizeof(buf)) = NOERROR then
WorkDir := copy(buf,1,lstrlen(@buf)) else WorkDir := "";
if GetIconLocation(@buf,sizeof(buf),i) = NOERROR then
begin
IconPath := copy(buf,1,lstrlen(@buf));
IcoIndex := i;
end else begin IconPath := ""; IcoIndex := 0; end;
if GetShowCmd(i) = NOERROR then
ShowCmd := i else ShowCmd := SW_SHOW;
result := true;
end;
end;


 
Song ©   (2002-06-23 11:29) [2]

См. методы класса IShellLink



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

Текущий архив: 2002.08.26;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.01 c
14-85163
lak_b
2002-07-29 12:21
2002.08.26
кто какие аккамуляторы юзает?


1-85083
Groove
2002-08-14 18:06
2002.08.26
Сортировка


14-85253
AL2002
2002-08-02 13:36
2002.08.26
ОС хватает, виндусов много, как программировать?..


3-84931
koks
2002-08-07 12:03
2002.08.26
ADO -> Access 2000 ????


1-84985
Геннадий
2002-08-15 23:13
2002.08.26
Как включить ActiveDesktop программно?