AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Font Schriftarten Verzeichnis ermitteln Vista
Thema durchsuchen
Ansicht
Themen-Optionen

Font Schriftarten Verzeichnis ermitteln Vista

Ein Thema von binio · begonnen am 20. Mai 2008 · letzter Beitrag vom 22. Jun 2008
Antwort Antwort
Benutzerbild von binio
binio

Registriert seit: 25. Nov 2005
Ort: Werl, Iserlohn, Dortmund, Hagen
85 Beiträge
 
Delphi 2006 Professional
 
#1

Font Schriftarten Verzeichnis ermitteln Vista

  Alt 20. Mai 2008, 13:59
Hallo wie komme ich unter Windows Vista an folgende Verzeichnisse:

Schriftarten
Programme

und die Aktuelle Windows Version

Genutzt habe ich bischener

CSIDL_FONTS = $0014;
// A virtual folder containing fonts. A typical path is C:\Windows\Fonts.

Delphi-Quellcode:
function GetShellFolder(CSIDL: Integer): string;

implementation

type
  PSHItemID = ^TSHItemID;
  {$EXTERNALSYM _SHITEMID}
  _SHITEMID = record
    cb: Word;
    abID: array[0..0] of Byte;
  end;
  TSHItemID = _SHITEMID;
  {$EXTERNALSYM SHITEMID}
  SHITEMID = _SHITEMID;

type
  PItemIDList = ^TItemIDList;
  {$EXTERNALSYM _ITEMIDLIST}
  _ITEMIDLIST = record
     mkid: TSHItemID;
   end;
  TItemIDList = _ITEMIDLIST;
  {$EXTERNALSYM ITEMIDLIST}
  ITEMIDLIST = _ITEMIDLIST;

function SHGetSpecialFolderLocation(hwndOwner: HWND; nFolder: Integer;
  var ppidl: PItemIDList): HResult; stdcall; external 'shell32.dllname 'SHGetSpecialFolderLocation';

function SHGetPathFromIDList(pidl: PItemIDList; pszPath: PChar): BOOL; stdcall; external 'shell32.dllname 'SHGetPathFromIDListA';

function GetShellFolder(CSIDL: Integer): string;
var
  pidl: PItemIdList;
  FolderPath: string;
  SystemFolder: Integer;
begin
  SystemFolder := CSIDL;
  if SUCCEEDED(SHGetSpecialFolderLocation(0, SystemFolder, pidl)) then
  begin
    SetLength(FolderPath, max_path);
    if SHGetPathFromIDList(pidl, Pchar(FolderPath)) then
    begin
      SetLength(FolderPath, length(Pchar(FolderPath)));
    end;
  end;
  Result := FolderPath;
end;
Tju unter Windows Vista gibt er mir anstelle von C:/Programm C:/Prog Files aus und bei dem Font Verzeichnis ein leeren String.
Hab nun gelesen das man unter Vista nicht mehr an die Schriftarten kommt

CLSID

Kann mir da bitte einer Helfen...

Gruß
Robert
if(copy_paste==false)
Programmierer=Hilflos;
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: Font Schriftarten Verzeichnis ermitteln Vista

  Alt 22. Jun 2008, 08:41
Hallo

Zitat von msdn:
Beginning with Windows Vista, applications should use the SHGetKnownFolderPath function and the REFKNOWNFOLDERID type to determine the full path to this folder. Existing applications that use the SHGetFolderPath function and the CSIDL type will continue to work.
SHGetKnownFolderPath Function
Thomas
  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 08:02 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