(Gast)
n/a Beiträge
|
Re: CD Laufwerk öffen - Wo ist das Problem?
4. Jun 2006, 19:09
hi, ok also hier komplett als Funktion:
Delphi-Quellcode:
function opendrive(driveletter: String): Boolean;
var
hr:THandle;
buffer: Cardinal;
ret:Boolean;
begin
hr := CreateFile(PChar('\\.\'+driveletter+':'),GENERIC_READ,FILE_SHARE_READ or FILE_SHARE_WRITE,NIL,OPEN_EXISTING,0,0);
if hr <> INVALID_HANDLE_VALUE then begin
ret := DeviceIOControl(hr,IOCTL_STORAGE_EJECT_MEDIA,NIL,0,NIL,0,buffer,NIL);
CloseHandle(hr);
end;
end;
|
|
Zitat
|