Connaitre chemin du dossier Démarrer/programmes

fabiin Messages postés 329 Date d'inscription mercredi 4 avril 2001 Statut Membre Dernière intervention 8 décembre 2009 - 12 déc. 2002 à 19:00
magicvinni Messages postés 235 Date d'inscription vendredi 25 avril 2003 Statut Membre Dernière intervention 26 juillet 2010 - 12 déc. 2002 à 22:04
Salut, comment connaitre le chemin contenant la liste des fichiers de Démarrer/Programme.

Merci

@+
Fabs 8-)

1 réponse

magicvinni Messages postés 235 Date d'inscription vendredi 25 avril 2003 Statut Membre Dernière intervention 26 juillet 2010
12 déc. 2002 à 22:04
Voici l'unité qui pourra t'aider :
unit wininfo;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Registry;

type
TWindowsInfo = class
private
{ Private declarations }
FDesktopDir: string;
FFavoritesDir: string;
FFontsDir: string;
FNetHoodDir: string;
FPersonalDir: string;
FProgramsDir: string;
FRecentDir: string;
FSendToDir: string;
FStartMenuDir: string;
FStartupDir: string;
FTemplatesDir: string;
protected
{ Protected declarations }
public
{ Public declarations }
// constructor Create(AOwner: TComponent);
constructor Create;
published
{ Published declarations }
property DesktopDir: string read FDesktopDir;
property FavoritesDir: string read FFavoritesDir;
property FontsDir: string read FFontsDir;
property NetHoodDir: string read FNetHoodDir;
property PersonalDir: string read FPersonalDir;
property ProgramsDir: string read FProgramsDir;
property RecentDir: string read FRecentDir;
property SendToDir: string read FSendToDir;
property StartMenuDir: string read FStartMenuDir;
property StartupDir: string read FStartupDir;
property TemplatesDir: string read FTemplatesDir;
end;

//procedure Register;

var
WindowsInfo: TWindowsInfo;

implementation

{
procedure Register;
begin
RegisterComponents('Extra', [TWindowsInfo]);
end;
}
constructor TWindowsInfo.Create;
const
WinKey = '\Software\Microsoft\Windows\CurrentVersion\';
ExplorerKey = '\Software\Microsoft\Windows\CurrentVersion\Explorer\';
var
Reg: TRegistry;
begin
inherited Create;

Reg := TRegistry.Create;
try
Reg.RootKey := HKey_Current_User;
if Reg.OpenKey(ExplorerKey+'Shell Folders', FALSE) then begin
FDesktopDir:=Reg.ReadString('Desktop');
FFavoritesDir:=Reg.ReadString('Favorites');
FFontsDir:=Reg.ReadString('Fonts');
FNetHoodDir:=Reg.ReadString('NetHood');
FPersonalDir:=Reg.ReadString('Personal');
FProgramsDir:=Reg.ReadString('Programs');
FRecentDir:=Reg.ReadString('Recent');
FSendToDir:=Reg.ReadString('SendTo');
FStartMenuDir:=Reg.ReadString('Start Menu');
FStartupDir:=Reg.ReadString('Startup');
FTemplatesDir:=Reg.ReadString('Templates');
end;
finally
Reg.Free;
end;
end;

begin
WindowsInfo:=TWindowsInfo.Create;
end.

Bonne prog
MagicVinni
0
Rejoignez-nous