LazFileUtils: fix compilation of GetShellLinkTargetAnsi for fpc 2.6.2.

git-svn-id: trunk@47324 -
This commit is contained in:
bart 2015-01-09 01:17:36 +00:00
parent bc7b2a12c3
commit d38d2f788b

View File

@ -286,14 +286,17 @@ begin
end; end;
function GetShellLinkTargetAnsi(const FileName: string): string; function GetShellLinkTargetAnsi(const FileName: string): string;
{$if (fpc_fullversion >= 20604)}
var var
ShellLinkA: IShellLinkA; ShellLinkA: IShellLinkA;
PersistFile: IPersistFile; PersistFile: IPersistFile;
WideFileName: WideString; WideFileName: WideString;
AnsiPath: array [0 .. MAX_PATH] of Char; AnsiPath: array [0 .. MAX_PATH] of Char;
WinFindData: WIN32_FIND_DATAA; WinFindData: WIN32_FIND_DATAA;
{$endif}
begin begin
Result := FileName; Result := FileName;
{$if fpc_fullversion >= 20604}
if (LowerCase(ExtractFileExt(FileName)) = '.lnk') then if (LowerCase(ExtractFileExt(FileName)) = '.lnk') then
begin begin
if (CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER, if (CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER,
@ -312,6 +315,7 @@ begin
end; end;
end; end;
end; end;
{$endif}
end; end;