Click here to Skip to main content
15,889,838 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900