You can check if any of the icons have the target you are searching for. The following function may be useful.
uses
Winapi.ShellAPI,
Winapi.ShlObj,
System.Win.ComObj,
System.Win.Registry,
Winapi.ActiveX
function ArquivoPeloLink(const NomeLink: String): String;
var
AObject: IUnknown;
ASLink: IShellLink;
APFile: IPersistFile;
WNomeLink: WideString;
PFD: TWin32FindData;
begin
AObject := CreateComObject(CLSID_ShellLink);
ASLink := AObject as IShellLink;
APFile := AObject as IPersistFile;
WNomeLink := NomeLink;
APFile.Load(PWideChar(WNomeLink), 0);
SetLength(Result, MAX_PATH);
ASLink.GetPath(PChar(Result), MAX_PATH, PFD, 0);
end;
I took it from here . Usage:
LinkArquivo := ArquivoPeloLink('C:\Users\Public\Desktop\Atalho.lnk')