Вниз
Скачать: 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 вся ветка

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



Память: 0.45 MB
Время: 0.009 c
1-85124
jessis
2002-08-15 11:55
2002.08.26
Параметр в командной строке


14-85219
AL2002
2002-07-29 18:06
2002.08.26
Двубайтовые числа


4-85304
olafpalmer
2002-06-21 16:19
2002.08.26
RichEdit 3.0


6-85140
DenKop
2002-06-13 20:17
2002.08.26
Подскажите алгоритм.


1-85061
kserg@ukr.net
2002-08-14 13:57
2002.08.26
ошибка QReport-a - что означает?




   Наверх