Click here to Skip to main content
15,922,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: controlling Dialog size on runtime Pin
ThatsAlok24-Aug-05 23:42
ThatsAlok24-Aug-05 23:42 
GeneralRe: controlling Dialog size on runtime Pin
Pazzuzu24-Aug-05 23:49
Pazzuzu24-Aug-05 23:49 
GeneralBlocking keyboard in the Menu Pin
shijuck24-Aug-05 22:55
shijuck24-Aug-05 22:55 
GeneralRe: Blocking keyboard in the Menu Pin
David Crow25-Aug-05 3:49
David Crow25-Aug-05 3:49 
Generalsend button Pin
Member 216100424-Aug-05 21:54
Member 216100424-Aug-05 21:54 
GeneralRe: send button Pin
ThatsAlok24-Aug-05 22:20
ThatsAlok24-Aug-05 22:20 
GeneralRe: send button Pin
Member 216100425-Aug-05 14:40
Member 216100425-Aug-05 14:40 
GeneralRe: send button Pin
kakan24-Aug-05 22:36
professionalkakan24-Aug-05 22:36 
I assume you wan't to eject the CD/DVD. If that's the case, use this:

BOOL ejectDisk(void)
{
char Drive[MAX_PATH];
HANDLE hDrive = INVALID_HANDLE_VALUE;
DWORD dwErr;
BOOL bRetVal = TRUE;
DWORD dwDummy;

// m_drive is a char, containing the drive letter for the unit you want to eject.
// I.e. char m_drive = 'G';

sprintf(Drive,"\\\\.\\%c:", m_drive);


hDrive = CreateFile(Drive, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

dwErr = GetLastError();

if(hDrive != INVALID_HANDLE_VALUE && dwErr == NO_ERROR) {
// Open OK, issue the eject command.
bRetVal = DeviceIoControl(hDrive, IOCTL_DISK_EJECT_MEDIA, NULL,
0, NULL, 0, &dwDummy, NULL);
}
else {
// Error at opening of the drive.
bRetVal = FALSE;
}

if(hDrive != INVALID_HANDLE_VALUE) CloseHandle(hDrive);
return bRetVal;
}

You need ntddstor.h from the DDK. That's where IOCTL_DISK_EJECT_MEDIA is defined.

GeneralRe: send button Pin
David Crow25-Aug-05 4:08
David Crow25-Aug-05 4:08 
GeneralHardware Acceleration.......... Pin
ashwath200524-Aug-05 21:48
ashwath200524-Aug-05 21:48 
GeneralRe: Hardware Acceleration.......... Pin
David Crow25-Aug-05 4:11
David Crow25-Aug-05 4:11 
GeneralRe: Hardware Acceleration.......... Pin
ashwath200528-Aug-05 22:42
ashwath200528-Aug-05 22:42 
GeneralRe: Hardware Acceleration.......... Pin
ashwath200528-Aug-05 22:45
ashwath200528-Aug-05 22:45 
GeneralRe: Hardware Acceleration.......... Pin
ashwath200528-Aug-05 22:54
ashwath200528-Aug-05 22:54 
GeneralRe: Hardware Acceleration.......... Pin
David Crow2-Sep-05 8:45
David Crow2-Sep-05 8:45 
GeneralWindow's Border Pin
Nishad S24-Aug-05 21:43
Nishad S24-Aug-05 21:43 
GeneralSHInvokePrinterCommand Pin
ashwath200524-Aug-05 21:41
ashwath200524-Aug-05 21:41 
General..NEW Help... pls Pin
cue_ball24-Aug-05 21:27
cue_ball24-Aug-05 21:27 
GeneralRe: ..NEW Help... pls Pin
Cedric Moonen24-Aug-05 21:32
Cedric Moonen24-Aug-05 21:32 
Generalwerwerwe Pin
ashwath200524-Aug-05 21:12
ashwath200524-Aug-05 21:12 
GeneralRe: werwerwe Pin
MailtoGops24-Aug-05 21:23
MailtoGops24-Aug-05 21:23 
GeneralRe: werwerwe Pin
ThatsAlok24-Aug-05 21:56
ThatsAlok24-Aug-05 21:56 
GeneralRe: werwerwe Pin
ashwath200524-Aug-05 22:26
ashwath200524-Aug-05 22:26 
GeneralRe: werwerwe Pin
ThatsAlok24-Aug-05 23:31
ThatsAlok24-Aug-05 23:31 
GeneralRe: werwerwe Pin
toxcct25-Aug-05 0:08
toxcct25-Aug-05 0:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.