Thread: cd tray

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    cd tray

    Does anyone know the source or know somewhere i could find the info that is needed to open and close the cd tray?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4
    gees nobody know this.

  3. #3
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    If you're using Windows, this should work (you'll have to replace the cd drive letter) -

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
    {
    	
    	DWORD bytes;
    	HANDLE HCDrom = CreateFile("\\\\.\\F:",GENERIC_READ,0,0,OPEN_EXISTING,0,0);
    
    	if(HCDrom==INVALID_HANDLE_VALUE)
    		cout << "error";
    
    	DeviceIoControl(HCDrom,IOCTL_STORAGE_EJECT_MEDIA, 0, 0,0, 0,&bytes,0);
    	return 0;
    }
    zen

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    look up MCISendString at msdn.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GTK+ Gnome desktop system tray app problem
    By BobS0327 in forum Linux Programming
    Replies: 2
    Last Post: 04-01-2006, 09:54 PM
  2. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  3. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 02:15 PM
  4. Nero CD recording take long time
    By Eagle16 in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 11-15-2002, 05:49 PM
  5. How to encrypt a CD perfectly?
    By Yin in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 03-13-2002, 09:02 AM