DTWAIN_GetDeviceEventEx

Top  Previous  Next

The DTWAIN_GetDeviceEventEx function gets supplemental information on the last device event that occurred.

 

DTWAIN_BOOL DTWAIN_GetDeviceEventEx (

DTWAIN_SOURCE

Source,

LPLONG

lpDeviceEvents,

LPDTWAIN_ARRAY

lpArray );

 

Parameters

Source

An open TWAIN Source.

 

lpDeviceEvent

Address of  LONG to store the last device event that occurred.

 

lpArray

Address of DTWAIN_ARRAY that will store extra information about the event that occurred.

 

Return Values

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

 

Comments

The DTWAIN_GetDeviceEventEx function gets the last device event that the Source Source has detected and any subsequent information about the event.  The lpDeviceEvent address points to a LONG that will be filled in with the last device event that occurred.  The device event will be equal one of the values defined in the DTWAIN_GetDeviceEvent function.  The lpArray is the address of a DTWAIN_ARRAY that will be filled with the extra information.

 

The DTWAIN_GetDeviceEventEx function is usually called when the DTWAIN_TN_DEVICEEVENT notification is sent to the application window.  For some events, there is no extra information that can be retrieved.  Once the DTWAIN_ARRAY has been created, you can use the DTWAIN Array functions to determine the type of data, the number of elements, and retrieve the actual data itself.

 

A list of the current device events that produce extra information that DTWAIN is aware of is following.  All the values in the Extra Information column are in order of their position in the DTWAIN_ARRAY.  For example, the DTWAIN_DE_CHKBATTERY information can be found in position 0 and 1 of the DTWAIN_ARRAY, with position 0 containing the minutes and posiiton 1 containing the percentage.

 

Device Event                        

Extra Information                                

 

DTWAIN_DE_CHKBATTERY        

Minutes (LONG)

Percentage (16-bit integer)

DTWAIN_DE_CHKPOWERSUPPLY

Current Power Supply (LONG)

DTWAIN_DE_CHKRESOLUTION        

X-Res (DTWAIN_FLOAT)

Y-Res (DTWAIN_FLOAT)

DTWAIN_DE_CHKFLASH        

Current Flash Setting (LONG)

DTWAIN_DE_CHKAUTOCAPTURE

Number of Images (LONG)

Time Before First Capture (LONG)

Time Between Captures (LONG)

 

If a device event does not return any extra information, the application can still get any information concerning the event by calling DTWAIN_GetDeviceEventInfo.  The advantage of using DTWAIN_GetDeviceEventEx is that DTWAIN knows which device events are guaranteed to return extra information.  In the event that a Source does return extra information for a device event that DTWAIN may not be aware of, the DTWAIN_GetDeviceEventInfo should be used.

 

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