L_IsTwainAvailable
#include "lttw2.h"
L_BOOL EXT_FUNCTION L_IsTwainAvailable(hWnd)
HWND hWnd; |
/* handle to a window */ |
Determines whether a TWAIN source is installed.
Parameter |
Description |
hWnd |
Handle to a window. (Internal TWAIN functions require a window handle; any valid window handle will work in this case.) |
Returns
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
LTTWN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
void TestTWAIN2(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"));
nRet = L_TwainInitSession(&hSession, &AppData);
if (nRet != SUCCESS)
return;
L_TwainAcquireList(hSession, hBitmap, NULL, LTWAIN_SHOW_USER_INTERFACE);
L_TwainEndSession(&hSession);
}
}