问题描述
任务:从移动SD卡或插入媒体并移除媒体的任何外部设备列出文件。
我已经处理了来自我窗口的** WM_DEVICECHANGE **消息,**它正常工作**当我连接任何外部驱动器**如笔式驱动器或任何其SD卡可直接访问的移动设备* *来自计算机(即不需要移动设备的安装许可)。
但是对于除非我们允许从移动设备访问SD卡而无法访问SD的移动设备,在这种情况下我没有得到任何来自Windows的回调。所以我无法枚举这些SD卡中的文件。
我找到了一个解决方案,使用SHChangeNotifyRegister和SHCNE_DISKEVENTS参数进行事件和SHCNE_MEDIAREMOVED | SHCNE_MEDIAINSERTED | SHCNE_DRIVEADD | SHCNE_DRIVEREMOVED用于设备和媒体通知。
但是我需要用WM_DEVICECHANGE消息处理它。
请帮助,
先谢谢。
Hi,
Task: To list out files from the mobile SD card or any external device with media insertion and removed.
I have handled **WM_DEVICECHANGE** message from my window, **it works properly** when I connect any external drive **like pen-drive or any mobile whose SD card is directly accessible** from computer(i.e. no need of mount permission from mobile).
But for mobile whose SD is not accessible unless we allow SD card access from mobile, In this case I don't get any callback from windows. so I'm unable to enumerate files from these SD card.
I have found one solution with using SHChangeNotifyRegister with SHCNE_DISKEVENTS parameter for events and SHCNE_MEDIAREMOVED | SHCNE_MEDIAINSERTED | SHCNE_DRIVEADD | SHCNE_DRIVEREMOVED for device and media notification.
But I need to handle it with WM_DEVICECHANGE message.
Please help,
Thanks In advance.
推荐答案
这篇关于获取SD卡安装/卸载通知&列出他们的文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!