Вниз
Скачать: 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-85108
dimanew
2002-08-15 05:52
2002.08.26
Есть задача из ул.ленина сделать ул.Ленина, я использую


6-85144
pfox
2002-06-14 23:07
2002.08.26
SMTP server


8-85132
ec
2002-04-16 16:51
2002.08.26
Вопрос по PaintBox y


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


8-85137
deema
2002-03-20 20:50
2002.08.26
Запись звука на диск




   Наверх