W
ww990
Unregistered / Unconfirmed
GUEST, unregistred user!
function GetNeedDrive:dword; stdcall;
var
tmpstr: string;
driver: char;
i, temp: integer;
drives: DWORD;
begin
drives := getlogicaldrives;
temp := (1 and drives);
for i := 0 to 26 do
begin
if temp = 1 then
begin
driver := char(i + integer('A'));
tmpstr := driver + ':/';
if (getdrivetype(pchar(tmpstr)) = DRIVE_CDROM) then
begin
//这里希望如果盘符类型中如有光驱
//则函数的返回值等于去除了光驱的getlogicaldrives的值;
//如我的电脑中有C:/,D:/,E:/,getlogicaldrives值是28
//去除了光驱D:/的值后,函数能返回值20
end;
end;
drives := (drives shr 1);
temp := (1 and drives);
end;
end;
var
tmpstr: string;
driver: char;
i, temp: integer;
drives: DWORD;
begin
drives := getlogicaldrives;
temp := (1 and drives);
for i := 0 to 26 do
begin
if temp = 1 then
begin
driver := char(i + integer('A'));
tmpstr := driver + ':/';
if (getdrivetype(pchar(tmpstr)) = DRIVE_CDROM) then
begin
//这里希望如果盘符类型中如有光驱
//则函数的返回值等于去除了光驱的getlogicaldrives的值;
//如我的电脑中有C:/,D:/,E:/,getlogicaldrives值是28
//去除了光驱D:/的值后,函数能返回值20
end;
end;
drives := (drives shr 1);
temp := (1 and drives);
end;
end;