用于检测/连接闪存驱动器插入的即插即用 API?
有没有办法在插入即插即用闪存驱动器并被 Windows 检测到后提供对用户定义程序的调用?
Is there a way to provide a call to a user-defined program after a plug-and-play flash drive has been inserted and detected by Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,微软终于发现自动运行程序存在巨大的安全风险,并且在插入驱动器时不再启动应用程序。
但是,插入驱动器时可以通知已安装并正在运行的应用程序。这样就足够了吗?查找
WM_DEVICECHANGE
,特别是DBT_DEVICEARRIVAL
带DBT_DEVTYP_VOLUME
案例。No, Microsoft finally figured out that autorun programs are a huge security risk, and no longer will start an application when a drive is inserted.
However, an application that's already installed and running can be notified when a drive is inserted. Is that sufficient? Look up
WM_DEVICECHANGE
and specifically theDBT_DEVICEARRIVAL
w/DBT_DEVTYP_VOLUME
case.