Schroetter - 2002-03-02

Logged In: YES
user_id=474176

#include <winioctl.h>

BOOL bRes;
DWORD dwRes;
HANDLE hDrive;
CString str="\\\\.\\E:";//E must be set with the letter of
the reader\writer to eject
hDrive=CreateFile
(str,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_
WRITE,NULL,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS|FILE_FL
AG_POSIX_SEMANTICS,NULL);
bRes=DeviceIoControl
(hDrive,IOCTL_STORAGE_EJECT_MEDIA,NULL,0,NULL,0,&dwRes,NULL
);

in c++(sorry if it's not good but it's the first time I
particip in sourceForge)