Autor Beitrag
Beatbox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Di 25.04.06 18:21 
Hallo!
Ich arbeite gerade an einem Bilderansichtsprogramm,
und würde gerne den Ordner "Eigene Bilder" vom
aktuell angemeldeten Benutzer ausfindig machen.

Super wäre es, wenn die "Eigene Bilder"-Ordner von
den restlichen Benutzern dabei ignoriert werden.

Weiß vielleicht jemand Rat ?

Ich hab schon ewig gesucht, konnte aber nichts
passendes finden.

Danke schonmal im Vorraus!

Beatbox
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 25.04.06 22:06 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
const
  CSIDL_FLAG_CREATE = $8000;
  CSIDL_ADMINTOOLS  = $0030;
  CSIDL_ALTSTARTUP  = $001D;
  CSIDL_APPDATA     = $001A;
  CSIDL_BITBUCKET   = $000A;
  CSIDL_CDBURN_AREA = $003B;
  CSIDL_COMMON_ADMINTOOLS = $002F;
  CSIDL_COMMON_ALTSTARTUP = $001E;
  CSIDL_COMMON_APPDATA = $0023;
  CSIDL_COMMON_DESKTOPDIRECTORY = $0019;
  CSIDL_COMMON_DOCUMENTS = $002E;
  CSIDL_COMMON_FAVORITES = $001F;
  CSIDL_COMMON_MUSIC = $0035;
  CSIDL_COMMON_PICTURES = $0036;
  CSIDL_COMMON_PROGRAMS = $0017;
  CSIDL_COMMON_STARTMENU = $0016;
  CSIDL_COMMON_STARTUP = $0018;
  CSIDL_COMMON_TEMPLATES = $002D;
  CSIDL_COMMON_VIDEO = $0037;
  CSIDL_CONTROLS    = $0003;
  CSIDL_COOKIES     = $0021;
  CSIDL_DESKTOP     = $0000;
  CSIDL_DESKTOPDIRECTORY = $0010;
  CSIDL_DRIVES      = $0011;
  CSIDL_FAVORITES   = $0006;
  CSIDL_FONTS       = $0014;
  CSIDL_HISTORY     = $0022;
  CSIDL_INTERNET    = $0001;
  CSIDL_INTERNET_CACHE = $0020;
  CSIDL_LOCAL_APPDATA = $001C;
  CSIDL_MYDOCUMENTS = $000C;
  CSIDL_MYMUSIC     = $000D;
  CSIDL_MYPICTURES  = $0027;
  CSIDL_MYVIDEO     = $000E;
  CSIDL_NETHOOD     = $0013;
  CSIDL_NETWORK     = $0012;
  CSIDL_PERSONAL    = $0005;
  CSIDL_PRINTERS    = $0004;
  CSIDL_PRINTHOOD   = $001B;
  CSIDL_PROFILE     = $0028;
  CSIDL_PROFILES    = $003E;
  CSIDL_PROGRAM_FILES = $0026;
  CSIDL_PROGRAM_FILES_COMMON = $002B;
  CSIDL_PROGRAMS    = $0002;
  CSIDL_RECENT      = $0008;
  CSIDL_SENDTO      = $0009;
  CSIDL_STARTMENU   = $000B;
  CSIDL_STARTUP     = $0007;
  CSIDL_SYSTEM      = $0025;
  CSIDL_TEMPLATES   = $0015;
  CSIDL_WINDOWS     = $0024;

////////////////////////////////////////////////////////////////////////////////
//  GetShellFolder
//  Returns the special shell folders
//  uses: ActiveX, ShlObj;
function GetShellFolder(CSIDL: integer): string;
var
  pidl              : PItemIdList;
  FolderPath        : string;
  SystemFolder      : Integer;
  Malloc            : IMalloc;
begin
  Malloc := nil;
  FolderPath := '';
  SHGetMalloc(Malloc);
  if Malloc = nil then
  begin
    Result := FolderPath;
    Exit;
  end;
  try
    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;
  finally
    Malloc.Free(pidl);
  end;
end;
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mi 26.04.06 17:17 
In der Delphi-Library hättest Du auch einen passenden Beitrag gefunden: ...wie kann ich spezielle Ordner finden?

Lg Martin

_________________
Ein Nutzer der Ecke ;-)