Вниз
Скачать: CL | DM;

Директория Windows   Найти похожие ветки 

 
Stype ©   (2005-02-08 17:23) [0]

Как узнать директорию, где установленна Windows ?


 
palva ©   (2005-02-08 18:48) [1]

{$APPTYPE CONSOLE}
uses windows;
var s: String;
begin
 SetLength(s, 250);
 SetLength(s, GetWindowsDirectory(PChar(s), 250));
 writeln(s);
end.


 
VMcL ©   (2005-02-08 19:01) [2]

>>palva ©   (08.02.05 18:48) [1]

Только не 250, а MAX_PATH.


 
palva ©   (2005-02-08 19:07) [3]

OK


 
palva ©   (2005-02-08 19:12) [4]

Можно даже так:
{$APPTYPE CONSOLE}
uses windows;
var s: String;
begin
 SetLength(s, GetWindowsDirectory(PChar(s), 0));
 GetWindowsDirectory(PChar(s), Length(s));
 writeln(s);
end.


 
rdm ©   (2005-02-08 22:22) [5]

Caption := SysUtils.GetEnvironmentVariable("windir");


 
VMcL ©   (2005-02-08 22:51) [6]

>>rdm ©   (08.02.05 22:22) [5]

Так делать не следует. Переменную окружения можно изменить.


 
Piter ©   (2005-02-08 23:29) [7]

Директория с Windows это - %SystemRoot%


 
VMcL ©   (2005-02-09 01:02) [8]

>>Piter ©   (08.02.05 23:29) [7]

В Win9x нет SystemRoot, есть только windir, AFAIR.


 
Fay ©   (2005-02-09 03:38) [9]

2 VMcL ©   (08.02.05 19:01) [2]
uSize
[in] Specifies the maximum size, in TCHARs, of the buffer specified by the lpBuffer parameter. This value should be set to MAX_PATH+1 to allow sufficient space for the path and the null terminator.


 
Fay ©   (2005-02-09 03:39) [10]

2 Piter ©   (08.02.05 23:29) [7]
Директория с Windows - это GetWindowsDirectory



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.037 c
14-1107255697
Dimedrol
2005-02-01 14:01
2005.02.20
Мелодию конвертнуть в "кнопки" для Nokia


6-1102328286
DelphiN!
2004-12-06 13:18
2005.02.20
Получение исход. вход. трафика из компонента TidMappedPortTCP


1-1107436283
JohnKorsh
2005-02-03 16:11
2005.02.20
Возможно ли стирание программой своего EXE файла ?


3-1106304368
Grab3
2005-01-21 13:46
2005.02.20
Mysql и Delphi


1-1107093457
Dr. Genius
2005-01-30 16:57
2005.02.20
Окошко с пунктами




   Наверх