or download this
SCANGETDATA()
Prototype:
SCAN_RESULT ScanGetData(HANDLE hScanner, TCHAR * lpBuff, LPINT BufSize
+);
...
If the application program doesn’t support callbacks, use 1 for the HA
+NDLE (if multi-scanner disabled) .
[out] lpBuff points to the buffer to receive the scanned data.
[in/out] BufSize points to the size of the buffer in bytes (not charac
+ters). Upon return, BufSize will be set to the number of bytes writte
+n into lpBuff. This can be converted to a character count by dividing
+ BufSize by sizeof(TCHAR). Typically the buffer size will be equal to
+ the character count on Win32 Desktop systems.