suppress autoplay

不羁岁月 提交于 2019-12-01 18:54:42

Sure. You can create a message-only window. That gives you a HWND without those annoying WM_PAINT messages etc. The other way is to use COM, IQueryCancelAutoplay

There is a registry entry that controls AutoRun:

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer 

This can be set to disable AutoRun on specific device types, from technet:

NoDriveTypeAutoRun

Value   Meaning
0x1     Disables Autoplay on drives of unknown type.
0x4     Disables Autoplay on removable drives.
0x8     Disables Autoplay on fixed drives.
0x10    Disables Autoplay on network drives.
0x20    Disables Autoplay on CD-ROM drives.
0x40    Disables Autoplay on RAM drives.
0x80    Disables Autoplay on drives of unknown type.
0xFF    Disables Autoplay on all types of drives.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!