#1 Burning Software

It is currently Wed Dec 18, 2024 10:52 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Disable Autorun ?
PostPosted: Mon Aug 23, 2004 7:12 am 
Offline

Joined: Wed Aug 18, 2004 11:47 am
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 ?
PostPosted: Mon Aug 23, 2004 12:09 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
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


Top
 Profile  
 
 Post subject: Re: Disable Autorun ?
PostPosted: Wed Aug 25, 2004 4:20 am 
Offline

Joined: Wed Aug 18, 2004 11:47 am
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
http://www.microsoft.com/msj/0998/win320998.aspx

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 ?
PostPosted: Wed Aug 25, 2004 9:07 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
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
http://www.microsoft.com/msj/0998/win320998.aspx

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 ?
PostPosted: Thu May 21, 2009 6:43 am 
Offline

Joined: Mon Aug 25, 2008 1:50 pm
Posts: 394
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 ?
PostPosted: Sat May 23, 2009 4:30 am 
Offline

Joined: Mon Aug 25, 2008 1:50 pm
Posts: 394
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 ?
PostPosted: Sat May 23, 2009 7:35 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Nice to know you've solved the issue and are happy :) Thank you for keeping us updated!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 39 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group