GetMessage v. PeekMessage loops
|
By default, internally the DTWAIN library will use the Windows API PeekMessage in an "infinite" loop during modal processing. This will work with the majority of TWAIN Data Sources. However it has been discovered that a small amount of TWAIN Sources will only work correctly if the API GetMessage is used in an infinite loop. You will be able to determine this if for some reason, the Source's user-interface does not respond to mouse clicks, or basically most user interaction. There are two main methods of having the GetMessage loop to be used: 1) Adding the Product Name of the device to the [TwainLoopGetMsg] in the dtwain32.ini or dtwain64.ini file, or 2) Calling the DTWAIN_EnablePeekMessageLoop function with FALSE as the argument. For method 1), the Product Name can be the full name, or a name with a wildcard that matches any source with the Product Name specified. For example: [TwainLoopGetMsg] MyScanner*=1 will match any Source with the Product Name starting with "MyScanner". Note that the name is case insensitive. The =1 denotes that any Source with starts with that name will use GetMessage when performing the TWAIN message loop. |