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.57 MB
Time: 0.024 c
14 - 22327
fliz
2001-11-05 15:39
2002.01.08
and they say the day after tomorrow is a holiday?


3 - 21939
SAN
2001-12-04 16:01
2002.01.08
MSSQL


3 - 21990
Skyr
2001-12-04 03:58
2002.01.08
Problem with LookUp - margins


4 - 22509
Karan
2001-11-08 12:50
2002.01.08
GetkeyboardState- What does?


1 - 22233
Delphimun
2001-12-15 12:47
2002.01.08
How to run a file in the Tolecontainer component





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 Spanish 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