问题
I'm adding Windows Portable Devices (WPD) support to an app that currently uses Windows Image Acquisition (WIA). WIA provides a handy picture selection dialog via IWiaItem::DeviceDlg.
I can't find a WPD equivalent. Is there one, and, if not, what is the preferred technique to allow users to select items? I don't have to write my own dialog, do I?
回答1:
Response from MS:
[T]here is no dedicated dialog for picture selection (outside of WIA). Instead, you should use the regular file open dialog which supports WPD device navigation. There will be some magic that needs to be done to start the dialog at the correct folder within the device. You might have to write code to find the folder(s) with pictures.
The magic path to pass to the File Open dialog is: ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\<device instance id>
The device instance id can be derived from the PnP Device Path via SetupApi calls (SetupDi*).
Further, the above path can include additional path elements to identify a specific folder on the device. These are different for every device model, but would look something like: ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\Store0\Pictures
来源:https://stackoverflow.com/questions/464965/wpd-equivalent-of-wia-devicedlg