禁止自动播放 [英] suppress autoplay

查看:36
本文介绍了禁止自动播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要抑制大容量存储设备的自动播放.这需要通过在后台运行的服务/守护程序以编程方式实现.

I need to suppress autoplay for the mass storage devices. This needs to be achieved programatically through a service/deamon running in the background.

我知道这可以通过打开一个窗口并处理 Windows 发送的queryCancelAutoPlay"消息的应用程序来完成.

I know it can be done by an application which opens a window and handles the "queryCancelAutoPlay" message sent by windows.

这可以在没有 GUI 的情况下完成吗.我有需要禁用自动播放的设备的 guid/pid/vid.

Can this be done without GUI.I have the guid/pid/vid for the device whose autoplay needs to be disabled.

推荐答案

好的.您可以创建仅消息窗口.这给你一个 HWND 没有那些烦人的 WM_PAINT 消息等.另一种方法是使用 COM,IQueryCancelAutoplay

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

这篇关于禁止自动播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆