Главная страница
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.016 c
1-85059
Bart
2002-08-14 13:34
2002.08.26
Реестр в 2000


1-84969
Vicheslav
2002-08-15 15:51
2002.08.26
Ув. Мастера помогите с Excel !????


1-84946
Nikson
2002-08-15 12:09
2002.08.26
Изменение кода класса ТStringGrid


4-85288
cult
2002-06-21 18:28
2002.08.26
Как убрать шапку с Caption из формы?


3-84918
Dim!S
2002-08-07 07:26
2002.08.26
Комбинированный фильтр