CD Insert Notification in WinXP

Discussion in 'Python' started by Tim O'Connell, Jan 21, 2004.

  1. Hi,

    I'm using Python 2.3 on a Win XP box, and I'm trying to find if there's
    a library of some sort that will give you a callback (or something
    comparable) when a new disc is inserted into a CD Rom drive. I've done a
    little googling and nothing's come up, so I'm not holding my breath. :)

    If not, I'm thinking of implementing a thread to periodically read the
    volume serial number using GetVolumeInformation from Mark Hammond's Win
    32 extensions, then doing a compare against the last known value. Does
    this sound "sane"? Any recommendations would be useful.

    Thanks!
    Tim
     
    Tim O'Connell, Jan 21, 2004
    #1
    1. Advertising

  2. > I'm using Python 2.3 on a Win XP box, and I'm trying to find if there's
    > a library of some sort that will give you a callback (or something
    > comparable) when a new disc is inserted into a CD Rom drive. I've done a
    > little googling and nothing's come up, so I'm not holding my breath. :)
    >
    > If not, I'm thinking of implementing a thread to periodically read the
    > volume serial number using GetVolumeInformation from Mark Hammond's Win
    > 32 extensions, then doing a compare against the last known value. Does
    > this sound "sane"? Any recommendations would be useful.


    Tim,

    Generally, Windows autoinsert notification can be enabled or disabled
    for data and audio disks independantly. When autoinsert notification is
    enabled on data disks, the Windows operating system automatically does
    what CD:\autorun.inf says.

    I would imagine that a similar thing occurs on audio cd inserts, except
    that it automatically calls the program that is associated with .cda
    files.

    Certainly there are hooks into the OS that allow one to intercept
    filesystem read/write calls (it is what virus scanners do), which could
    be tested to see if the read is from a cdrom drive, but I don't know if
    Mark Hammond's extensions would be enough, though it is doubtful.


    I would suggest polling the serial number every 5 seconds or so, making
    sure to deal with the various exception conditions.

    - Josiah
     
    Josiah Carlson, Jan 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Golden

    RE: CD Insert Notification in WinXP

    Tim Golden, Jan 21, 2004, in forum: Python
    Replies:
    1
    Views:
    892
    Tim Golden
    Jan 21, 2004
  2. cannontrodder
    Replies:
    1
    Views:
    734
    cannontrodder
    Jul 25, 2006
  3. Replies:
    1
    Views:
    454
  4. Replies:
    1
    Views:
    1,788
    Albert Hopkins
    Dec 6, 2008
  5. eagle

    Insert & Insert/Repeat buttons in a detailsview

    eagle, Jul 12, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    1,061
    eagle
    Jul 12, 2007
Loading...

Share This Page