Open GoogleCodeExporter opened 8 years ago
This is an issue that goes all the way down to a Twain_32.dll level. The twain
specification expects to have a window handle so that it can send messages to
the host application, including but not limited to Transferring Images,
Initializing the Scan process, and Showing Modal Dialogs to automate the
process. Without this window handle, you can't use a Twain device. The
workaround I've found (in WPF, but there's an alias in WinForms) is to create a
window class specifically to handle Twain, create that window in its own thread
and give it its own message pump. When the process you want to complete is
finished, then close the window. If you Join this thread immediately after
starting it, then the process will block and behave as if you just asked the
Twain device to scan. The downside is that you will now have a weird window
just popping up when you need to scan, but it's better than having to convolute
your main UI thread and event processing.
Original comment by specialf...@gmail.com
on 7 Feb 2014 at 1:42
Original issue reported on code.google.com by
mree.oso...@gmail.com
on 31 May 2013 at 3:47