Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   API de Windows (https://www.clubdelphi.com/foros/forumdisplay.php?f=7)
-   -   variables (https://www.clubdelphi.com/foros/showthread.php?t=17109)

Chupi 23-12-2004 16:01:58

variables
 
SALUDOS

quisiera saber con exactitud cuales son las variables para:

- Windows XP
- Windows 2000

... que me lleven al siguiente directorio:

C:\documents and settings\cualquierusuario\...

Neftali [Germán.Estévez] 24-12-2004 11:21:26

Cita:

Empezado por Chupi
C:\documents and settings\cualquierusuario\...

Se puede hacer vía API;
Crea un form, coloca un Memo y un botón y en el OnClick del botón lo siguiente:

Código Delphi [-]
 procedure TForm1.Button1Click(Sender: TObject);
 Var
   SFolder :  pItemIDList;
   SpecialPath : Array[0..MAX_PATH] Of Char;
   i:Integer;
 const
   DIR: array[0..16] of Integer =
     (CSIDL_STARTUP, 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);
 begin
 
   for i := 0 to 16 do begin
     SHGetSpecialFolderLocation(Form1.Handle, DIR[i], SFolder);
     SHGetPathFromIDList(SFolder, SpecialPath);
     Memo1.Lines.Add(SpecialPath);
   end;
 end;

Añade ShlObj al USES.


La franja horaria es GMT +2. Ahora son las 12:05:55.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi