Rocket Division Software
http://www.starburnsoftware.com/forum/

Disable Autorun ?
http://www.starburnsoftware.com/forum/starburn-sdk-f3/disable-autorun-t107.html
Page 1 of 1

Author:  christan [ Mon Aug 23, 2004 7:12 am ]
Post subject:  Disable Autorun ?

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

Author:  anton (staff) [ Mon Aug 23, 2004 12:09 pm ]
Post subject:  Re: Disable Autorun ?

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

Author:  christan [ Wed Aug 25, 2004 4:20 am ]
Post subject:  Re: Disable Autorun ?

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 :)

Author:  anton (staff) [ Wed Aug 25, 2004 9:07 am ]
Post subject:  Re: Disable Autorun ?

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 :)

Author:  deepakp [ Thu May 21, 2009 6:43 am ]
Post subject:  Re: Disable Autorun ?

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.

Author:  deepakp [ Sat May 23, 2009 4:30 am ]
Post subject:  Re: Disable Autorun ?

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. :)

Author:  anton (staff) [ Sat May 23, 2009 7:35 am ]
Post subject:  Re: Disable Autorun ?

Nice to know you've solved the issue and are happy :) Thank you for keeping us updated!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/