Get the file pointed by its link name
(Go to index)str1
:= 'Resolving link: ' + wBuffer + ' --> ' + ResolveTheLink( myLinkName);
messageDlg( str1, mtInformation, [mbOK], 0 );
function ResolveTheLink( LinkName: string ): string;
var
aBuffer: array[0..200] of char;
wBuffer: WideString;
shlLink: IShellLink;
persFile: IPersistFile;
win32FindData: Twin32FindData;
res: HResult;
begin
shlLink := CreateComObject( CLSID_SHellLink ) as IShellLink;
persFile := shlLink as IPersistFile;
wBuffer := EditLnkName.text + '.lnk';
res := persFile.load( pwChar(wBuffer), STGM_READ );
res := shlLink.getPath( aBuffer, 200, win32FindData, 0 );
result := strPas(aBuffer);
end;
Go to index