Selecting a Device (WIA)

When an application connects to a Windows Image Acquisition (WIA) hardware device, WIA creates an item tree (a hierarchical tree of IWiaItem or IWiaItem2 interfaces) that represents the device and its images, folders, and scanning beds. An application can select and connect to a device without user input, or it can display a dialog box that allows a user to select a device.

Selecting a Device Without the UI

Perform the following steps to select and connect to a WIA hardware device.

For an example of how to do this in an application, see Creating a Device in the tutorial section of this guide.

Selecting a Device With the UI

After retrieving a pointer to IWiaDevMgr, an application can allow a user to select a device by skipping the rest of the above steps and calling IWiaDevMgr::SelectDeviceDlg. The IWiaDevMgr::SelectDeviceDlg displays a dialog box in which the user can select a WIA device.

It is recommended that applications make device and image selection available through a menu item named From scanner on the File menu.