DTWAIN_GetDeviceNotifications

Top  Previous  Next

The DTWAIN_GetDeviceNotifications function gets the device events that the application is allowed to capture.

 

DTWAIN_BOOL DTWAIN_GetDeviceNotifications (

DTWAIN_SOURCE

Source,

LPLONG

lpDeviceEvents );

 

Parameters

Source

An open TWAIN Source.

 

lpDeviceValues

Address of LONG to store the current device events to capture.

 

Return Values

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

 

Comments

The DTWAIN_GetDeviceNotifications function gets the device events that will be sent by the Source.

The Source Source  must be selected using one of the Source Selection Functions.  Calling DTWAIN_SetDeviceNotifications sets up device notifications.  By default, no device events are set up for capture.

 

The lpDeviceEvents address points to a LONG that will be filled in with the device events that the Source will capture.  To interpret the LONG value, the device events are specified as bits within the value.  A bit-wise AND with the LONG at address lpDeviceEvents and one of the constants defined in DTWAIN below can determine if the Source has been set up to capture the device event

 

 

Value

Meaning

 

DTWAIN_DE_CHKAUTOCAPTURE

The automatic capture settings        on the device have been changed.

DTWAIN_DE_CHKBATTERY        

Status of the battery has changed.

DTWAIN_DE_CHKDEVICEONLINE

The device may have been powered off.

DTWAIN_DE_CHKFLASH                

The flash setting has changed.

DTWAIN_DE_CHKPOWERSUPPLY

The power supply has changed.

DTWAIN_DE_CHKRESOLUTION        

The resolution of the device has changed.

DTWAIN_DE_DEVICEADDED        

A device has been added to the Source.

DTWAIN_DE_DEVICEOFFLINE        

The device has become unavailable. The device is assumed to be connected.

DTWAIN_DE_DEVICEREADY

A device is ready to capture another image.

DTWAIN_DE_DEVICEREMOVED

A device has been removed from the Source.

DTWAIN_DE_DEVICEOFFLINE

The device is off-line.

DTWAIN_DE_PAPERDOUBLEFEED

Report a double feed to the application.

DTWAIN_DE_PAPERJAM                

Report a paper jam to the application.

 

The DTWAIN_IsCapSupported function can be used to test if device events are supported by the Source.  The capability, DTWAIN_CV_CAPDEVICEEVENT is used as the cap to test.  Even though DTWAIN always checks if the capability is supported when the DTWAIN_GetDeviceNotifications function is called, an application will be able to determine itself whether a Source can perform device events.

 

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