如何可靠地检查 Windows 7 中是否启用了自动播放?

发布于 2024-10-02 03:02:43 字数 432 浏览 0 评论 0原文

我有一个处理 WM_DEVICECHANGE 的应用程序,并且对 DBT_DEVICEARRIVAL 感兴趣。 当插入新设备时,需要知道是否会弹出自动播放对话框。为了找到答案,我检查了

HKCU 和 HKLM 下SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

中 NoDriveAutoRun 和 NoDriveTypeAutoRun 的值。 但是,如果用户转到“控制面板 -> 自动播放”并取消选中“对所有媒体和设备使用自动播放”,则自动播放实际上被禁用,但不会设置这些注册表值。在我的测试盒上,默认情况下它们甚至不存在。我相信大多数用户会使用控制面板方法来禁用自动播放,而不是本地组策略编辑器。

所以,我的问题是,复选标记设置是什么(我想是某个注册表值?)。无论我尝试什么,我似乎无法(可靠地)弄清楚自动播放是否已启用。

I have an application that handles WM_DEVICECHANGE, and is interested in DBT_DEVICEARRIVAL.
When a new device is inserted, it needs to know if the AutoPlay dialog will pop-up. In order to find out, I am checking the values of NoDriveAutoRun and NoDriveTypeAutoRun in

SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

under HKCU and HKLM.
However, if a user goes to the "Control Panel -> AutoPlay" and unchecks "Use AutoPlay for all media and devices", then the AutoPlay is effectively disabled, but those registry values are not set. On my test box they aren't even there by default. And I believe that most users would use the Control Panel approach to disable the AutoPlay, rather than the Local Group Policy Editor.

So, my question is, what is that check mark setting (a registry value somewhere i suppose?). No matter what I try, I can't seem to (reliably) figure out if the AutoPlay is enabled or not.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿! 2024-10-09 03:02:43

当启用自动播放时,CD-ROM 驱动器上下文菜单上似乎会出现“自动播放”动词。所以你可以测试一下。

It seems like an "AutoPlay" verb appears on the CD-ROM drive context menu when AutoPlay is enabled. So you could test for that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文