Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CD drive Take no Action - programaticaly set
Message
From
30/01/2003 02:03:56
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00746977
Message ID:
00747035
Views:
24
>I have an app that queries data log files, using parameterized views. The source file for the view can be a file on the network server, or an archive file on a CD.
>Based on the events date, the app looks at the files available on the network or prompts the user for inserting the required CD. All works well except that the CD drive is set to take some action when loading a CD - usually, it opens a folder.
>In this app case I want to set the drive to take no action when loading a CD, and then, of course I'd like to restore the original setting.
>From what I've read, it seems there is a bit in a registry key that controls this... Does anybody have code to do what I described safely?

I'd guess you've already seen:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/autorun/autoplay_reg.asp

Do your users really *need* Autorun? Do you _have_ to restore the original setting? :-)

My guess would be that the "unreliable" part of using the Registry method in the above link refers to restoring Autorun to "Yes" - this may not be reliable while the machine is running. However, I would think on a fresh boot it would be turned back on successfully, presuming it depends (solely) on that registry setting.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform