![]() |
Re: Verknüpfungen (shortcuts) lesen
Delphi-Quellcode:
Allererste Sahne. Funktioniert einwandfrei, gibt aber wegen "SLGP_SHORTPATH" (wie erwähnt) nur 8-Zeichen-lange Pfade zurück, stört aber nicht beim Ausführen von Dateien.
uses ShlObj, ComObj, ActiveX;
function GetLinkDestination(s: WideString): string; var aShellLink : IShellLink; aPersistFile : IPersistFile; szData : array[0 .. MAX_PATH] of char; aFindData : TWin32FindData; begin aShellLink := CreateComObject(CLSID_ShellLink) as IShellLink; aPersistFile := aShellLink as IPersistFile; OleCheck(aPersistFile.Load(PWidechar(s),STGM_READ)); OleCheck(aShellLink.GetPath(szData,MAX_PATH,aFindData,SLGP_SHORTPATH)); Result := szData; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:00 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz