#1 Burning Software

It is currently Wed Dec 18, 2024 11:14 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to detect when a CD or DVD is inserted in the drive?
PostPosted: Wed Jun 25, 2008 3:37 pm 
Offline

Joined: Mon Mar 31, 2008 6:17 pm
Posts: 7
I am using StarBurnX Version 10.0.00 ( Build 2008-03-3 ). I would like to know if there is a faster way to detect if there is a cd or a dvd in a specified drive.

At the moment I'm using the Windows API WM_DEVICECHANGE event to detect the media arrival and change event, which works unless there is no disc inserted. If no disc is inserted, but the tray is opened and the disc is removed, it doesn't notify me.

Is there any provision in StarBurnX itself to detect the event?


Top
 Profile  
 
 Post subject: Re: How to detect when a CD or DVD is inserted in the drive?
PostPosted: Wed Jun 25, 2008 5:18 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Use GetInsertedDiscType(...) equivalent. And check for NO_MODIA (no disc) or other value (other disc). That's is...

DS1 wrote:
I am using StarBurnX Version 10.0.00 ( Build 2008-03-3 ). I would like to know if there is a faster way to detect if there is a cd or a dvd in a specified drive.

At the moment I'm using the Windows API WM_DEVICECHANGE event to detect the media arrival and change event, which works unless there is no disc inserted. If no disc is inserted, but the tray is opened and the disc is removed, it doesn't notify me.

Is there any provision in StarBurnX itself to detect the event?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 3:50 am 
Offline

Joined: Mon Mar 31, 2008 6:17 pm
Posts: 7
Is there an event that fires when the media type or disc ejected/changed?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 9:50 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Unfortunately no. To provide such a functionality we'll have to do what Windows and Linux do - keep backgrond thread pinging all devices with "test unit ready" or "get media event status". This requires quite a lot of activities and constant handle toss. It's better idea to use Windows notification or keep a separate thread controlled by your own application.

DS1 wrote:
Is there an event that fires when the media type or disc ejected/changed?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group