L_IsTwainAvailable

#include "lttwn.h"

L_LTTWN_API L_BOOL L_IsTwainAvailable(hWnd)

Determines whether a TWAIN source is installed.

Parameters

HWND hWnd

Handle to a window. (Internal TWAIN functions require a window handle; any valid window handle will work in this case.)

Returns

Value Meaning
TRUE At least one TWAIN source is installed.
FALSE No TWAIN source is installed.

Comments

You can use this function when deciding whether to enable or disable TWAIN menu items.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT IsTwainAvailableExample(HWND hWnd,HBITMAPLIST hBitmap) 
{ 
   L_BOOL bAvailable; 
   L_INT nRet; 
   HTWAINSESSION hSession = NULL; 
   APPLICATIONDATA AppData; 
 
   /* Check to see if TWAIN is installed */ 
   bAvailable = L_IsTwainAvailable(hWnd); 
   if (bAvailable) 
   { 
      AppData.uStructSize = sizeof(APPLICATIONDATA); 
      AppData.hWnd = hWnd; 
      lstrcpy (AppData.szManufacturerName, TEXT("LEAD Technologies, Inc.")); 
      lstrcpy (AppData.szAppProductFamily, TEXT("LEAD Test Applications")); 
      lstrcpy (AppData.szVersionInfo, TEXT("Version 1.0")); 
      lstrcpy (AppData.szAppName, TEXT("TWAIN Test Application")); 
      AppData.uLanguage = TWLG_ENGLISH_USA; 
      AppData.uCountry  = TWCY_USA; 
      nRet = L_TwainInitSession(&hSession, &AppData); 
      if (nRet != SUCCESS)  
         return nRet; 
 
      nRet = L_TwainAcquireList(hSession, hBitmap, NULL, LTWAIN_SHOW_USER_INTERFACE); 
      if(nRet != SUCCESS) 
         return nRet; 
      nRet = L_TwainEndSession(&hSession); 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.