AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Pfad zu Application Data herauslesen
Thema durchsuchen
Ansicht
Themen-Optionen

Pfad zu Application Data herauslesen

Ein Thema von Flinto · begonnen am 16. Jan 2006 · letzter Beitrag vom 4. Mai 2007
Antwort Antwort
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#1

Re: Pfad zu Application Data herauslesen

  Alt 18. Jan 2006, 09:16
Ich habe mal eben D5 angeworfen:

Delphi-Quellcode:
program Demo;
{$APPTYPE CONSOLE}
uses
  Windows,
  SysUtils,
  ActiveX,
  ShlObj;

function IncludeTrailingPathDelimiter(path: String): String;
begin
  Result := IncludeTrailingBackslash(path);
end;

function GetSpecialFolderLocation(csidl: integer): string;
var
  pMalloc: IMalloc;
  pidl: PItemIDList;
  path: array [0..MAX_PATH] of Char;
begin
  Result := '?';
  if SHGetMalloc(pMalloc) = S_OK then
  begin
    SHGetSpecialFolderLocation(0, csidl, pidl);
    SHGetPathFromIDList(pidl, path);
    Result := IncludeTrailingPathDelimiter(Path);
    pMalloc.Free(pidl);
  end;
end;

begin
  WriteLn(GetSpecialFolderLocation($23));
end.
Das Herzstück ist der API-Call SHGetSpecialFolderLocation() und zu dem sagt der Windows Platform SDK:

Code:
Minimum DLL Version shell32.dll  version 4.7 or later
Custom Implementation            No
Header                           shlobj.h
Import library                   shell32.lib
Minimum operating systems        Windows NT 4.0, Windows 95
marabu
  Mit Zitat antworten Zitat
Antwort Antwort


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 09:48 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