uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls
,
activeX
,shlObj;
type
TForm1 =
class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
TKnownFolderManager =
class(TInterfacedObject, IKnownFolderManager)
public
function FolderIdFromCsidl(nCsidl: Integer;
var pfid: TKnownFolderID): HRESULT;
stdcall;
function FolderIdToCsidl(
const rfid: TIID;
var pnCsidl: Integer): HRESULT;
stdcall;
function GetFolderIds(ppKFId:
array of TKnownFolderID;
var pCount: UINT): HRESULT;
stdcall;
function GetFolder(
const rfid: TIID;
out ppkf: IKnownFolder): HRESULT;
stdcall;
function GetFolderByName(pszCanonicalName: LPCWSTR;
out ppkf: IKnownFolder): HRESULT;
stdcall;
function RegisterFolder(
const rfid: TIID;
var pKFD: TKnownFolderDefinition): HRESULT;
stdcall;
function UnregisterFolder(
const rfid: TIID): HRESULT;
stdcall;
function FindFolderFromPath(pszPath: LPCWSTR; mode: FFFP_MODE;
out ppkf: IKnownFolder): HRESULT;
stdcall;
function FindFolderFromIDList(pidl: PItemIDList;
out ppkf: IKnownFolder): HRESULT;
stdcall;
function Redirect(
const rfid: TIID; hwnd: HWND; flags: TKFRedirectFlags;
pszTargetPath: LPCWSTR; cFolders: UINT;
var pExclusion: TKnownFolderID;
var ppszError: LPWSTR): HRESULT;
stdcall;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
io : TKnownFolderManager;
count : Cardinal;
vielefolder :
array of TKnownFolderID;
buffer :
array [0..1024]
of byte
absolute vielefolder;
begin
io:=TKnownFolderManager.Create;
io.GetFolderIds(vielefolder,count);
Memo1.Lines.Add('
Anz:'+inttostr(count));
end;