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

Местонахождение WINDOWS SYSTEM32 DRIVERS   Найти похожие ветки 

← →
Leaner ©   (2004-10-15 15:32) [0]

Здравствуйте !
Подскажите, пожалуйста, как определить
директорию, в которой находяться
драйвера (\WINDOWS\SYSTEM32\DRIVERS)?


← →
antonn ©   (2004-10-15 15:37) [1]

uses ActiveX, ShlObj;

function TDirectorys.SpecialDir(Spec:integer):string;
var
 Allocator: IMalloc;
 SpecialDir: PItemIdList;
 FBuf: array[0..MAX_PATH] of Char;
 PerDir: string;
begin
 if SHGetMalloc(Allocator) = NOERROR then
 begin
   SHGetSpecialFolderLocation(application.Handle,  spec , SpecialDir);
   SHGetPathFromIDList(SpecialDir, @FBuf[0]);
   Allocator.Free(SpecialDir);
   result:=string(FBuf);
 end;
end;

function TDirectorys.DRIVES:string;
begin
result:=SpecialDir(CSIDL_DRIVES);
end;


← →
Leaner ©   (2004-10-15 15:43) [2]

>antonn
Спасибо !


← →
Leaner ©   (2004-10-15 15:58) [3]

Проблеммы:
SpecialDir(CSIDL_DRIVES) выдает пустую строку.
И я в хелпе натолкнулся на следующее:
"the following special folders are pure virtual and cannot be mapped to a directory path:
CSIDL_INTERNET, CSIDL_CONTROLS, CSIDL_PRINTERS,  CSIDL_BITBUCKET, CSIDL_DRIVES
CSIDL_NETWORK, CSIDL_ALTSTARTUP, CSIDL_COMMON_ALTSTARTUP"


← →
clickmaker ©   (2004-10-15 17:54) [4]

GetSystemDirectory()  + "\DRIVERS"


← →
GanibalLector ©   (2004-10-15 20:14) [5]

2 clickmaker
Слегка расширю :
GetSystemDirectory(QQ,GetSystemDirectory(nil,0))


← →
GuAV ©   (2004-10-15 23:56) [6]


> GetSystemDirectory(QQ,GetSystemDirectory(nil,0))

Имхо лучше так
I:=GetSystemDirectory(nil,0));
SetLength(S, I-1);
GetSystemDirectory(PChar(S),I))


← →
GanibalLector ©   (2004-10-16 02:13) [7]

2 GuAV
SetLength(S, I-1);
А не плюс ли там???Почему минус,мотивируйте!!!


← →
GanibalLector ©   (2004-10-16 02:18) [8]

2 GuAV
Пардон...Осознал!


← →
GuAV ©   (2004-10-16 02:23) [9]

GetSystemDirectory

...

Return Values

If the function succeeds, the return value is the length, in characters, of the string copied to the buffer, not including the terminating null character.

/* наш случай: */
If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path.
/* надо полагать, including the terminating null  */


В AnsiString включён Null-terminator, его позиция = длина_строки + 1
т.е. -1 мы делаем not including the terminating null character


← →
InfMag ©   (2004-10-16 16:40) [10]

Хм. Я обычно вычитываю строчки из реестра, чтобы определить сис. пути...



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

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



Память: 0.47 MB
Время: 0.022 c
14-1100134186
Ihor Osov'yak
2004-11-11 03:49
2004.11.28
Что-то типа DelForEx, но для VS6


3-1098953421
Tolya
2004-10-28 12:50
2004.11.28
как вывести в dbtext1 поле таблици????


4-1098098594
Islander
2004-10-18 15:23
2004.11.28
Работа с глобальными "горячими" клавишами


14-1099310768
DeMoN-777
2004-11-01 15:06
2004.11.28
Wireless


1-1100474931
Германн
2004-11-15 02:28
2004.11.28
Не могу сформулировать!




   Наверх