Jump to content

Suggestion: Acquiring from one source


Recommended Posts

This is a little thing, but when Acquire is selected from the File menu, would it be possible to skip the Select Device dialog when there is only one device listed? If there's only one device available, why do I have to select it? I think it would be safe to assume that's the one I want and proceed with the scan.

Link to comment
Share on other sites

I figured the dialog was provided by Windows. I don't know exactly how it's handled in the code, but it sounds like the default Windows behavior is to not show the dialog when there's only one device.

From http://msdn2.microsoft.com/en-us/library/ms630143.aspx:

If IWiaDevMgr::GetImageDlg finds only one matching device, it will not display the Select Device dialog box. Instead, it will select the matching device. You can override this behavior and force IWiaDevMgr::GetImageDlg to display the Select Device dialog box by passing WIA_SELECT_DEVICE_NODEFAULT as the value for the lFlags parameter.

Perhaps there's not a combination of lDeviceType and lFlags parameters that will allow device types to be unrestricted while also suppressing the Select Device dialog box. The MSDN article only specifies that the Select Device dialog can be forced with the lFlags parameter and that lDeviceType parameter has to be set to something other than null before there's any chance the Select Device dialog will be skipped.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...