Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How I know CD-ROM's door is Opened or Closed?

How I know CD-ROM's door is Opened or Closed?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Love In Snowing
    wrote on last edited by
    #1

    I am writing a program. In this program I wanna know whether the CD-ROM's door is Opened or Closed? How I can write code?:confused:

    J H 2 Replies Last reply
    0
    • L Love In Snowing

      I am writing a program. In this program I wanna know whether the CD-ROM's door is Opened or Closed? How I can write code?:confused:

      J Offline
      J Offline
      Jens Kreiensiek
      wrote on last edited by
      #2

      hi there, a good starting point is to search the MSDN for MCI. Another (but much harder) way is the function DeviceIoControl(). ..have fun.. jk :cool:

      L 1 Reply Last reply
      0
      • L Love In Snowing

        I am writing a program. In this program I wanna know whether the CD-ROM's door is Opened or Closed? How I can write code?:confused:

        H Offline
        H Offline
        HintiFlo
        wrote on last edited by
        #3

        Try (file-)reading-routines on the CD, if it fails drive is open, if it doesn't fail, drive is closed

        1 Reply Last reply
        0
        • J Jens Kreiensiek

          hi there, a good starting point is to search the MSDN for MCI. Another (but much harder) way is the function DeviceIoControl(). ..have fun.. jk :cool:

          L Offline
          L Offline
          Love In Snowing
          wrote on last edited by
          #4

          I wanna know which Function I can use ?

          J 1 Reply Last reply
          0
          • L Love In Snowing

            I wanna know which Function I can use ?

            J Offline
            J Offline
            Jens Kreiensiek
            wrote on last edited by
            #5

            mciSendCommand() or DeviceIOControl(). There's no Function like Is_Drive_A_CDRom_And_If_Its_So_Is_The_Tray_Open(LPCTSTR pszDrive). RTFM :-D ..have fun.. jk :cool:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups