Rocket Division Software

CD/DVD/Blu-Ray/HD-DVD recording, iSCSI and AoE (ATA-over-Ethernet)




 [ 7 posts ] 
AuthorMessage
 Post subject: Disable Autorun ?
Posted:
Offline

Joined: W
Posts: 12
Hi,

Does anyone know how to temporarily disable autorun/autplay ? I am writing an app that needs to burn a CD, then eject and load, followed by validation of the data that was burned to the CD. The problem I am facing is that when my app eject and load, Windows autorun/autoplay feature will try to read from the CD, but because my app locks the drive, Windows will pop up an error message.

Now, I am aware of that Windows sends a "QueryCancelAutoPlay" message to the foreground window, and that we can suppress the autorun/autoplay by responding to that message. My problem is that my app runs hidden in the background, so it never receives this message :-/

Would really appreciate any help you can give ... thanks in advance.

Regards,
Christopher Tan


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline
Site Admin

Joined: F
Posts: 3409
Location: British Virgin Islands
Christian,

I do not know myself and would only recommend Google-ing the topic. But maybe other guys here would be wiser then me

P.S. I do disable autorun myself always if you care. I think you know the reason

christan wrote:
Hi,

Does anyone know how to temporarily disable autorun/autplay ? I am writing an app that needs to burn a CD, then eject and load, followed by validation of the data that was burned to the CD. The problem I am facing is that when my app eject and load, Windows autorun/autoplay feature will try to read from the CD, but because my app locks the drive, Windows will pop up an error message.

Now, I am aware of that Windows sends a "QueryCancelAutoPlay" message to the foreground window, and that we can suppress the autorun/autoplay by responding to that message. My problem is that my app runs hidden in the background, so it never receives this message :-/

Would really appreciate any help you can give ... thanks in advance.

Regards,
Christopher Tan

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline

Joined: W
Posts: 12
Hi Anton,

I have just done quite a bit of research on this and here is what I turned up:

Autoplay in Windows XP: Automatically Detect and React to New Devices on a System
http://msdn.microsoft.com/msdnmag/issues/01/11/autoplay/default.aspx

Jeffrey Richter's Explanation on Autorun


The above two articles should give quite a good overview of how to work with Autorun and Autoplay.

IQueryCancelAutoPlay Interface Reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iquerycancelautoplay/iquerycancelautoplay.asp

A Useful Discussion on IQueryCancelAutoPlay
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=Xns94E65829AE7D4macnealliinetnetau%40207.105.83.66&rnum=9&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3DXns94E65829AE7D4macnealliinetnetau%2540207.105.83.66%26rnum%3D9

Complete C++ Implementation Code Sample
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=Xns94E65829AE7D4macnealliinetnetau%40207.105.83.66&rnum=9


Well, after finding all the above info, it looks like the only RELIABLE way to stop Autoplay from triggering is to use IQueryCancelAutoPlay.

However, I have to admit I don't have much knowledge on COM programming in Delphi (the dev environment I am using).

Anton, any chance you might consider adding support to temporarily Enable/Disable Autorun/Autoplay into Starburn SDK ? ... I think this is something that would be useful to most users who use Starburn SDK.

All the above info and code samples are in C++, so it should be relatively easy as compared to me having to learn COM, then figure out how to translate that into Delphi.

Well, keeping my fingers crossed

Regards,
Chris


anton (staff) wrote:
Christian,

I do not know myself and would only recommend Google-ing the topic. But maybe other guys here would be wiser then me

P.S. I do disable autorun myself always if you care. I think you know the reason


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline
Site Admin

Joined: F
Posts: 3409
Location: British Virgin Islands
Christian,

looks like you've did a nice job searching the net and createing indexed results

I do not think we'll be adding autoplay management to StarBurn SDK. B/s there are quite a lot of much more important tasks in the current TODO list. And I'm not a big fan of converting burning library into "Swiss Army Knife" suitable for everything.

christan wrote:
Hi Anton,

I have just done quite a bit of research on this and here is what I turned up:

Autoplay in Windows XP: Automatically Detect and React to New Devices on a System
http://msdn.microsoft.com/msdnmag/issues/01/11/autoplay/default.aspx

Jeffrey Richter's Explanation on Autorun


The above two articles should give quite a good overview of how to work with Autorun and Autoplay.

IQueryCancelAutoPlay Interface Reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iquerycancelautoplay/iquerycancelautoplay.asp

A Useful Discussion on IQueryCancelAutoPlay
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=Xns94E65829AE7D4macnealliinetnetau%40207.105.83.66&rnum=9&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3DXns94E65829AE7D4macnealliinetnetau%2540207.105.83.66%26rnum%3D9

Complete C++ Implementation Code Sample
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=Xns94E65829AE7D4macnealliinetnetau%40207.105.83.66&rnum=9


Well, after finding all the above info, it looks like the only RELIABLE way to stop Autoplay from triggering is to use IQueryCancelAutoPlay.

However, I have to admit I don't have much knowledge on COM programming in Delphi (the dev environment I am using).

Anton, any chance you might consider adding support to temporarily Enable/Disable Autorun/Autoplay into Starburn SDK ? ... I think this is something that would be useful to most users who use Starburn SDK.

All the above info and code samples are in C++, so it should be relatively easy as compared to me having to learn COM, then figure out how to translate that into Delphi.

Well, keeping my fingers crossed

Regards,
Chris


anton (staff) wrote:
Christian,

I do not know myself and would only recommend Google-ing the topic. But maybe other guys here would be wiser then me

P.S. I do disable autorun myself always if you care. I think you know the reason

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline

Joined: M
Posts: 236
Hello Support,

I have already used "IQueryCancelAutoPlay" which is used by getting MessageID of this autoplay and then checking this in WndProc of Main form, but I am facing following problem:
If any top-level form isopen other than main form or application is minimized then I am not able to get AutoPlay event message in WndProc. And cannot suppress AutoPlay.

Is this problem faced by any of user? If yes then if we can suppress the AutoPlay even any dialog or MessageBox is active. I googled a bit nothing I found. One more thing I don't want to use registry. [Becoz Vista Requires UAC to access registry]
Can anyone help me?
Thank you in advance.


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline

Joined: M
Posts: 236
Hello Support,

Found a work around for this problem. Fixed for my custom dialogs. It works well, but fails if Windows MessageBoxes are the top-most. But that's fine.
Thank you.


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
Posted:
Offline
Site Admin

Joined: F
Posts: 3409
Location: British Virgin Islands
Nice to know you've solved the issue and are happy Thank you for keeping us updated!

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software


Top
 Profile  
 
 [ 7 posts ]