Select TWAIN Source (VB.NET 2005)

D

Dustin Davis

I'm hoping there is a TWAIN expert lurking here somewhere :)

I'm writing a very customized application. The software will be set up
in multiple location and will always have two types of scanners attached
to the computer. The scanners are microfilm/fiche and a flatbed.

So I've created a scanner setup screen where the user can select the
twain source for the fiche/film scanner and the twain source for the
flatbed scanner. I'm using an active x control to select the twain
source so that is simple enough, the problem comes in storing that
source or setting it manually. There is no way to do this in my active x
control.

Can someone tell me how this might be done in VB.NET? Basically, on the
main form there is a radio button for Fiche/Film and one for Flatbed. I
would like to programatically set the twain source depending on which
radio button is checked.

Help please! :)
 
D

Dustin Davis

Sorry, I've looked at these already and the code connect to a dll, which
also shows the dialog to select the TWAIN source. I still couldn't find
a way to select the TWAIN source without showing the dialog box.

The system seems to remember the last TWAIN source selected. Does anyone
know where it stores this information. I was thinking that if there were
an ascii file somewhere, or a registry setting, I could modify that...
 
D

Dustin Davis

So, using Filemon & Regmon
(http://www.sysinternals.com/Utilities/Regmon.html) I was able to find a
registry entry for the default TWAIN source. On my machine it is located at
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Twain\Default Source

Now this begs the question, how can I determine where it would be
located on Win XP or other OS versions? And how do I read & write to the
registry in VB.NET?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top