Registriert seit: 19. Okt 2005
Ort: umgezogen --> Hamburg :-(
42 Beiträge
Delphi 7 Enterprise
|
Re: BOOLEAN? Programm Problem!
8. Jan 2006, 19:27
So,
Delphi-Quellcode:
function GetVolumeName(DriveLetter: Char): string;
var
dummy: DWORD;
buffer: array[0..MAX_PATH] of Char;
oldmode: LongInt;
begin
oldmode := SetErrorMode(SEM_FAILCRITICALERRORS);
try
GetVolumeInformation(PChar(DriveLetter + ':\'),
buffer,
SizeOf(buffer),
nil,
dummy,
dummy,
nil,
0);
Result := StrPas(buffer);
finally
SetErrorMode(oldmode);
end;
end;
// Example, Beispiel:
procedure TForm1.Button1Click(Sender: TObject);
begin
Caption := GetVolumeName('c');
end;
Daniel
|
|
Zitat
|