Вниз
Скачать: 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-85084
Skfi
2002-08-14 08:06
2002.08.26
Текстовый файл


3-84894
Oleon
2002-08-05 11:00
2002.08.26
Здраствуйте, господа программисты.


1-85044
Andrey Shakula
2002-08-14 11:06
2002.08.26
dsgnintf.pas


14-85211
Delph
2002-07-31 18:29
2002.08.26
Клиент для форума существует?


7-85269
eviruswork
2002-06-14 13:47
2002.08.26
Меню файлов




   Наверх