DTWAIN_GetDeviceEventInfo

Top  Previous  Next

The DTWAIN_GetDeviceEventInfo gets information related to the last device event that occurred.

 

DTWAIN_BOOL DTWAIN_GetDeviceEventInfo (

DTWAIN_SOURCE

Source,

LONG

WhichInfo,

LPVOID

lpValue );

 

Parameters

Source

An open TWAIN Source.

 

WhichInfo

A Value denoting which event information to retrieve.

 

lpValue

A Value denoting which event information to retrieve.

 

Return Values

The return value is TRUE if successful.  Otherwise FALSE is returned.

 

Comments

The DTWAIN_GetDeviceEvent function gets information with respect to the last device event that the Source Source has detected.  The DTWAIN_GetDeviceEventInfo function is usually called when the DTWAIN_TN_DEVICEEVENT notification is sent to the application window.

 

The WhichInfo parameter is a LONG that denotes the device information desired.  Below is a list of the WhichInfo values and their definitions.

 

WhichInfo

Meaning

 

DTWAIN_GETDE_EVENT                        

Device Event that occurred

DTWAIN_GETDE_DEVNAME                

Device Name

DTWAIN_GETDE_BATTERYMINUTES        

Battery Minutes Left

DTWAIN_GETDE_BATTERYPCT                

Battery Percentage

DTWAIN_GETDE_XRESOLUTION        

Current X-Resolution

DTWAIN_GETDE_YRESOLUTION                

Current Y-Resolution

DTWAIN_GETDE_FLASHUSED                

Current Flash setting

DTWAIN_GETDE_AUTOCAPTURE        

Automatic Capture

DTWAIN_GETDE_TIMEBEFORECAPTURE

Time Before 1st Captures

DTWAIN_GETDE_TIMEBETWEENCAPTURES

Time Between Captures

DTWAIN_GETDE_POWERSUPPLY

Power Supply

 

The lpValue is the address of the variable that will receive the value.  Each event defined by WhichInfo returns a value that is a certain type.  Below is a list of variable types that are returned:

 

WhichInfo

Variable Type

 

DTWAIN_GETDE_EVENT                        

LONG (unsigned)

DTWAIN_GETDE_DEVNAME        

DTWAIN_STRING

DTWAIN_GETDE_BATTERYMINUTES

LONG (unsigned)

DTWAIN_GETDE_BATTERYPCT        

LONG (signed)

DTWAIN_GETDE_XRESOLUTION                

DTWAIN_FLOAT

DTWAIN_GETDE_YRESOLUTION                

DTWAIN_FLOAT

DTWAIN_GETDE_FLASHUSED

LONG (unsigned)

DTWAIN_GETDE_AUTOCAPTURE

LONG (unsigned)

DTWAIN_GETDE_TIMEBEFORECAPTURE

LONG (unsigned)

DTWAIN_GETDE_TIMEBETWEENCAPTURES

LONG (unsigned)

DTWAIN_GETDE_POWERSUPPLY

LONG (signed)

 

The DTWAIN_GetDeviceEventInfo should be used if the application needs to know extra information about an event if the application is sure that DTWAIN_GetDeviceEventEx is not giving the extra information for a device event.  This may occur if a Source decides to give extra information about a device event that DTWAIN is not aware of.

 

For more information on device events, see the topic Capturing Source Device Events.

 

TWAIN State Transitions

The Source must be in State 4. or higher

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

DTWAIN Source Selection Function

 

 

See Also

Special Source Device Events