ImageGear for C and C++ on Windows v19.1 - Updated
IG_TWAIN_source_get_default
API Reference Guide > TWAIN Component API Reference > TWAIN Component Functions Reference > Source Functions > IG_TWAIN_source_get_default

This function returns the name of the current or "default" Data Source.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_TWAIN_source_get_default(
        HWND hMainWnd,
        LPSTR lpszDSName
);

Arguments:

Name Type Description
hMainWnd HWND The handle of the main window in the application.
lpszDSName LPSTR Returns a string identifying which Data Source is currently the default. You must allocate the memory for this string. Please allow 34 characters per the TWAIN restriction.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

The "default" Data Source is the source that was either last opened or installed. Initially, one of your TWAIN devices will be active by default. The default Data Source may be reset by calling the function IG_TWAIN_source_open().

Used in conjunction with IG_TWAIN_source_get_first() and IG_TWAIN_source_get_next(), you can implement your own version of TWAIN's "SelectSource" dialog box, adding customized enhancements or sophistication.