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)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)