L_TwainQueryFileSystem

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainQueryFileSystem(hSession, FileMsg, pTwFile)

Performs certain tasks, or retrieves certain information, depending on the value of the FileMsg parameter.

Parameters

HTWAINSESSION hSession

Handle to an existing TWAIN session. This handle is obtained by calling the L_TwainInitSession or L_TwainInitSession2 function.

FILESYSTEMMSG FileMsg

File system messages that determine the behavior of the function. For possible values, refer to the FILESYSTEMMSG.

If the FileMsg parameter contains one of the following flags, this function will use the provided information to change settings within the TWAIN file system:

The pTwFile parameter must contain the proper information before calling this function.

If the FileMsg parameter contains one of the following flags, this function will update the pTwFile parameter with the corresponding information:

If the FileMsg parameter contains the following flag, this function will use information stored within the pTwFile parameter and will update the pTwFile parameter with any appropriate information:

FILESYSTEMMSG_AUTOMATICCAPTUREDIRECTORY

pTW_FILESYSTEM pTwFile

Pointer to a TW_FILESYSTEM structure. This structure will be updated with, or will contain information used to change, the current TWAIN file system settings. This structure must be allocated.

Returns

Value Meaning
SUCCESS The function was successful.
! = SUCCESS An error occurred. Refer to Return Codes.

Comments

This function is only valid for TWAIN file systems for digital cameras.

This function must be called after calling the L_TwainStartCapsNeg function and before calling the L_TwainEndCapsNeg function.

For more information on the TW_FILESYSTEM structure, please refer to the TWAIN specification.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT TwainQueryFileSystemExample(HWND hWnd) 
{ 
   HTWAINSESSION hSession; 
   APPLICATIONDATA AppData; 
   TW_FILESYSTEM twFileSys; 
 
   AppData.hWnd = hWnd; 
   lstrcpy (AppData.szManufacturerName, TEXT("LEAD Technologies, Inc.")); 
   lstrcpy (AppData.szAppProductFamily, TEXT("LEAD Sample")); 
   lstrcpy (AppData.szVersionInfo, TEXT("Version 1.0")); 
   lstrcpy (AppData.szAppName, TEXT("LEAD Sample")); 
   AppData.uStructSize = sizeof(APPLICATIONDATA); 
 
   L_INT nRet = L_TwainInitSession(&hSession, &AppData); 
   if (nRet != TWAIN_SUCCESS) 
   { 
      MessageBox(hWnd, TEXT("Error occurred during L_TwainInitSession"), TEXT("Notice"), MB_OK); 
      return nRet; 
   } 
  
   nRet = L_TwainStartCapsNeg(hSession); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   memset(&twFileSys, 0, sizeof(TW_FILESYSTEM)); 
   nRet = L_TwainQueryFileSystem(hSession, FILESYSTEMMSG_AUTOMATICCAPTUREDIRECTORY, &twFileSys); 
   if (nRet != TWAIN_SUCCESS)  
   { 
      MessageBox(hWnd, TEXT("Error occurred during L_TwainQueryFileSystem"), TEXT("Notice"), MB_OK); 
      return nRet; 
   } 
    
   nRet = L_TwainEndCapsNeg(hSession); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_TwainEndSession(&hSession); 
   if(nRet != SUCCESS) 
      return nRet; 
 
    
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help