Autor Beitrag
MasterT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 67

Win XP x64, Win 98, Win 2000, Win ME
D6 Prof., Delphi 2006
BeitragVerfasst: Fr 30.07.04 01:20 
Hallo,

weiß jemand von euch, ob es einen einfacheren Weg gibt den Ordner der Temporären Internet Dateien zu finden außer über die Registry? Die Pfade stehen normalerweise im Schlüssel HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. Es ist kein Problem, mir eine Funktion zu basteln, aber rein aus Interesse würde ich das gerne wissen obs da irgendein API Call oder so gibt.

Vielen Dank im Vorraus

Gruß

MasterT
becker
Hält's aus hier
Beiträge: 9

WIN98, WINXP
D5 Enterprise, D6 Prof, D7 Prof
BeitragVerfasst: Fr 30.07.04 08:36 
Ja, das geht. Hier ein Code-Beispiel aus meiner Datenbank:

ausblenden 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:
function GetSpecialFolder(hWindow: HWND; Folder: Integer): String; 
var 
  pMalloc: IMalloc; 
  pidl: PItemIDList; 
  Path: PChar; 
begin 
  // get IMalloc interface pointer 
  if (SHGetMalloc(pMalloc) <> S_OK) then begin 
    MessageBox(hWindow, 'Couldn''t get pointer to IMalloc interface.', 
               'SHGetMalloc(pMalloc)', 16); 
    Exit; 
  end; 

  // retrieve path 
  SHGetSpecialFolderLocation(hWindow, Folder, pidl); 
  GetMem(Path, MAX_PATH); 
  SHGetPathFromIDList(pidl, Path); 
  Result := Path; 
  FreeMem(Path); 

  // free memory allocated by SHGetSpecialFolderLocation 
  pMalloc.Free(pidl); 
end;


procedure TForm1.Button1Click(Sender: TObject); 
begin 
  ShowMessage(GetSpecialFolder(Handle, CSIDL_RECENT)); 
end;


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
CSIDL_COOKIES              Cookies 
CSIDL_DESKTOPDIRECTORY     Desktop 
CSIDL_FAVORITES            Favoriten 
CSIDL_HISTORY              Internet-Verlauf 
CSIDL_INTERNET_CACHE       "Temporary Internet Files" 
CSIDL_PERSONAL             Eigene Dateien 
CSIDL_PROGRAMS             "Programme" im Startmenü 
CSIDL_RECENT               "Dokumente" im Startmenü 
CSIDL_SENDTO               "Senden an" im Kontextmenü 
CSIDL_STARTMENU            Startmenü 
CSIDL_STARTUP              Autostart



Moderiert von user profile iconPeter Lustig: Code- und Delphi-Tags hinzugefügt.
MasterT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 67

Win XP x64, Win 98, Win 2000, Win ME
D6 Prof., Delphi 2006
BeitragVerfasst: Fr 30.07.04 14:44 
Ah ok, die Funktion ist mir bekannt, kannte aber die Constante nicht dafür ^^.
In meiner Win32 Hilfe steht die nicht drin ^^

Das steht bei mir:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
CSIDL_BITBUCKET  
CSIDL_CONTROLS  
CSIDL_DESKTOP  
CSIDL_DESKTOPDIRECTORY  
CSIDL_DRIVES  
CSIDL_FONTS  
CSIDL_NETHOOD  
CSIDL_NETWORK  
CSIDL_PERSONAL  
CSIDL_PRINTERS  
CSIDL_PROGRAMS  
CSIDL_RECENT  
CSIDL_SENDTO  
CSIDL_STARTMENU  
CSIDL_STARTUP  
CSIDL_TEMPLATES


Trotzdem Vielen Dank

Gruß

MasterT
r4id3n
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 115

Win XP Home, Win XP Pro
D6 Prof, D7 Ent, K3 Ent
BeitragVerfasst: Sa 07.08.04 13:28 
Benutz einfach die TJVDirectories von den JVCL Komonenten, die haben eine Funktion Cache, die dir den Longpath des IECachefolders gibt!


r4id3n