WPD equivalent of WIA DeviceDlg

落花浮王杯 提交于 2019-12-14 01:44:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!