AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Windows 11 Desktop-Shortcut erstellen

Ein Thema von DieDolly · begonnen am 23. Jan 2024 · letzter Beitrag vom 24. Jan 2024
 
DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#1

Windows 11 Desktop-Shortcut erstellen

  Alt 23. Jan 2024, 20:05
Ich habe leider gerade kein Windows 11 aber mir wurde gesagt, dass der Code unten keinen Desktop-Shortcut mehr unter Windows 11 erstellt.
Gibt es da neue Restriktionen unter Windows 11? Weiß da jemand was?

Delphi-Quellcode:
// Create desktop shortcut
function createLink(const AFileName, ALinkFileName, AParameter, ALinkDestination: string): Boolean;
var
 psl: IShellLink;
 ppf: IPersistFile;
begin
 Result := False;

 if Succeeded(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_inPROC_SERVER, IID_IShellLinkW, psl)) then
  begin
   psl.SetPath(PChar(AFileName));
   psl.SetArguments(PChar(AParameter));
   psl.SetWorkingDirectory(PChar(ExtractFilePath(AFileName)));

   if Succeeded(psl.QueryInterface(IPersistFile, ppf)) then
    begin
     ppf.Save(PChar(ALinkDestination + ALinkFileName + '.lnk'), True);
     Result := True;
    end;
  end;
end;

// Delete desktop shortcut
procedure deleteShortCuts(const AProfileName: string; ALinkDestination: string);
begin
 ALinkDestination := ALinkDestination + AProfileName + '.lnk';

 if FileExists(ALinkDestination) then
  DeleteFile(ALinkDestination);
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:31 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz