Home › Forums › TWAIN Classic › How do you determine if a scanner is powered on or not
- This topic has 2 replies, 2 voices, and was last updated 17 years ago by CCS.
- AuthorPosts
I am using VB.net and I am trying to get my application to determine if the scanner is online. I have tried using the isTWAINavailable as follows:
If LEAD1.IsTwainAvailable(LEAD1.hWnd) Then
…
oddly enough that same/similar code works in VB6 as outlined below:
If LEAD1.IsTwainAvailable(hWnd) Then
…
Let me know if I am missing something or if there is a better way of doing this.
@CCS wrote:
I am using VB.net and I am trying to get my application to determine if the scanner is online.
I’m not familiar with the VB library you are using but it should provide a way to query capabilities via the DG_CONTROL/DAT_CAPABILITY/MSG_GET triplet. CAP_DEVICEONLINE will tell you if the scanner is online. Read about that capability, and capabilities in general, in the TWAIN specification.
I guess it would help to mention that I am using LEADTOOLS library 12.0 which seemingly does not have any appearant DG_CONTROL/DAT_CAPABILITY/MSG_GET triplet. Unless this is stored in a separate file kind of like the *.ini settings file the TWAIN driver creates for my Fujitsu Scanner then I have no clue where to find these settings. I will keep tearing through the attribute library to see what I can find.
- AuthorPosts