Home
Top.Mail.Ru Yandeks.Metrika
Forum: "System";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Windows Favorites Find similar branches


Schummi   (2001-09-15 07:45) [0]

Hello masters! Please answer the following question - How to find out where the Wind user and her language (Russian or English) are located on the user's computer, or rather, how to find out where the Favorites folder is located? Thanks in advance!



Ajax   (2001-09-15 22:30) [1]

All system folders.

procedure TForm1.FormCreate (Sender: TObject);
was
reg: TRgistry;
ts: TStrings;
i: integer;
begin
reg: = TRegistry. Create;
reg.RootKey: = HKEY_CURRENT_USER;
reg.LazyWrite: = false;
reg.OpenKey ("Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Shell Folders", false);
ts: = TStringList.Create;
reg.GetValueNames (ts);
for i: = 0 to ts.Count -1 do begin
Memo1.Lines.Add (ts.Strings [i] + "=" + reg.ReadString (ts.Strings [i]));
end;
ts.Free;
reg.CloseKey;
reg.free;
end;



Schummi   (2001-09-16 07:22) [2]

Thank you, Ajax!



Борисов Александр   (2001-09-17 01:32) [3]

In the book "Delphi 3.0 For All" (Fedorov AG, ed. "ComputerPress", 1998), in the section "How to make an installer" I found the following code:
was
SPath: Array [0..MAX_Path-1] of Char;
Path: String;
..............
begin
// Preparatory work: find the directory in which it is located
// Windows and create a route to the WINDOWS / DESKTOP directory, where
// stored labels displayed in the workspace

GetWindowsDirectory (sPath, MAX_PATH);
Path: = StrPas (sPath);
Path: = Path + "\ DESKTOP \";
.............

Here is the code.



Schummi   (2001-09-22 07:42) [4]

Thank you and Borisov Alexander!



[N\A]   (2001-09-22 14:50) [5]

and something else on the subject ... only using api ...
function GetWinDir: string;
was
Buf: array [0..MAX_PATH] of Char;
begin
GetWindowsDirectory (@Buf [0], MAX_PATH + 1);
Result: = PChar (@Buf [0]);
if Result <> "" then
if Result [Length (Result)] <> "\" then
Result: = Result + "\";
end;

function GetSysDir: string;
was
Buf: array [0..MAX_PATH] of Char;
begin
GetSystemDirectory (@Buf [0], MAX_PATH + 1);
Result: = PChar (@Buf [0]);
if Result <> "" then
if Result [Length (Result)] <> "\" then
Result: = Result + "\";
end;

function GetTempDir: string;
was
Buf: array [0..MAX_PATH] of Char;
begin
Windows.GetTempPath (MAX_PATH + 1, @ Buf [0]);
Result: = PChar (@Buf [0]);
if Result <> "" then
if Result [Length (Result)] <> "\" then
Result: = Result + "\";
end;

function ReadRegStr (RootKey: HKey; SubKey, Value: String): String;
was
C: Array [0..254] of Char;
T, S: DWORD;
K: HKEY;
begin
Result: = "";
T: = REG_SZ;
S: = SizeOf (c);
if RegOpenKeyEx (RootKey, PChar (SubKey), 0, KEY_READ, K) = ERROR_SUCCESS then
if RegQueryValueEx (K, PChar (Value), nil, @ T, @ C, @ S) = ERROR_SUCCESS then
Result: = C;
RegCloseKey (K);
end;

function GetShellFolderPath (const Name: String): String;
was
S: string;
begin
S: = ReadRegStr (HKEY_CURRENT_USER, "Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Shell Folders", Name);
Result: = s + "\";
end;

Desktop - Desktop
Favorites - Favorites

if GetShellFolderPath ("Favorites") <> "\" then
s: = GetShellFolderPath ("Favorites");



Pages: 1 whole branch

Forum: "System";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.83 MB
Time: 0.025 c
3-21915
KAA
2001-12-04 10:28
2002.01.08
Resetting the MSSQL2000 variable


4-22486
Pantero
2001-11-03 23:59
2002.01.08
Handle


14-22363
Dense
2001-11-02 18:16
2002.01.08
Well ...?


1-22077
Art
2001-12-18 17:19
2002.01.08
Question to pascalshchik ???


4-22458
Ajax
2001-10-31 17:50
2002.01.08
TColor and RGB





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish