#include "lttwn.h"

L_LTTWN_API L_INT L_TwainSetProperties (hSession, pltProperties, uFlags, pfnCallBack, pUserData)

Sets predefined capabilities of the TWAIN source in the form of properties.



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


Pointer to a LTWAINPROPERTIES structure that contains the values to set.

L_UINT uFlags

Flags that indicate whether to set or reset the property values. Possible values are:

Value Meaning
LTWAIN_PROPERTIES_SET [1] Set the properties to the values specified in the LTWAINPROPERTIES structure.
LTWAIN_PROPERTIES_RESET [2] Set the properties to their default values neglecting the values specified in the LTWAINPROPERTIES structure. In this case the LTWAINPROPERTIES pointer can be NULL since it is not used.


Optional callback function, called as each property is set. It lets the user know if an error occurred during the set operation and lets the user abort or retry.

If you do not provide a callback function, use NULL as the value of this parameter. No error reporting will occur. If you do provide a callback function, use the function pointer as the value of this parameter. The callback function must adhere to the function prototype described in LTWAINSETPROPERTYCALLBACK function.

L_VOID * pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.


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


The function can set the values of the properties to the values specified in the LTWAINPROPERTIES structure or it can reset the values defined in the structure to their default values defined by the TWAIN source.

This function must be called after L_TwainStartCapsNeg is called and before L_TwainEndCapsNeg is called.

Required DLLs and Libraries

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.