DTWAIN_GetDeviceEventEx
The DTWAIN_GetDeviceEventEx function gets supplemental information on the last device event that occurred.
DTWAIN_BOOL DTWAIN_GetDeviceEventEx (
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.
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 Source Selection Function
See Also |