WPD相当于WIA DeviceDlg [英] WPD equivalent of WIA DeviceDlg
问题描述
我正在将Windows便携式设备(WPD)支持添加到当前使用Windows Image Acquisition(WIA)的应用程序中. WIA通过IWiaItem :: DeviceDlg提供了方便的图片选择对话框.
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.
我找不到等效的WPD.是否有一种,如果没有,允许用户选择项目的首选技术是什么?我不必编写自己的对话框,对吗?
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?
推荐答案
来自MS的响应:
[T]此处没有用于图片选择的专用对话框(在WIA之外).相反,您应该使用支持WPD设备导航的常规文件打开对话框.需要执行一些魔术操作才能在设备内的正确文件夹处启动对话框.您可能必须编写代码才能找到带有图片的文件夹.
[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.
传递到文件打开"对话框的神奇路径是: :: {20D04FE0-3AEA-1069-A2D8-08002B30309D} \<设备实例ID>
The magic path to pass to the File Open dialog is: ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\<device instance id>
可以通过SetupApi调用(SetupDi *)从PnP设备路径派生设备实例ID.
The device instance id can be derived from the PnP Device Path via SetupApi calls (SetupDi*).
此外,以上路径可以包含其他路径元素,以标识设备上的特定文件夹.对于每种设备型号,这些都有所不同,但是看起来像: :: {20D04FE0-3AEA-1069-A2D8-08002B30309D} \\ Store0 \ Pictures
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
这篇关于WPD相当于WIA DeviceDlg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!