Home › Forums › TWAIN Classic › Do I Need a Handle?
- This topic has 1 reply, 2 voices, and was last updated 9 years, 4 months ago by MarkM.
- AuthorPosts
I’m a TWAIN noob. Currently, I’m building software for an interactive touch screen that operates with a scanner. Looking at the toolkit, it implements code for a Windows Forms UI use case.
Does TWAIN for C# have a use case for programmatic-access, too? My touch screen is not a browser or windows form, but the interactive touch screen software interacts with a C# DLL. I’d like to make the call from the C# DLL without having to “new” a Handle. Is this possible?
You should be able to supply the window handle for either the desktop or a console Window, and get the result you desire. You might also a able to create a hidden window. Unfortunately, most TWAIN drivers require a message pump to communicate asynchronous events, like MSG_XFERREADY. Since your solution is self-contained, you could experiment with an alteration to the open source Data Source Manager to disable the requirement for a HWND, and then poll the TWAIN driver for the first image using DG_IMAGE / DAT_IMAGEINFO / MSG_GET, which will return an error until the first image is ready for transfer…
- AuthorPosts