8.11
S
CAN
S
ET
G
OOD
R
EAD
S
OUND
()
Prototype:
SCAN_RESULT ScanSetGoodReadSound(HANDLE hScanner, GRS_TYPE Sound, LPCTSTR lpWavFile);
Purpose:
Tells the ScanAPI DLL to be silent, call MessageBeep(0), or play a .wav file when the user
successfully scans data with the specified device.
Arguments:
[in] hScanner is the value received by the client application in lParam of the WM_INSERTION
message specified when ScanInit() was called.
If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner
disabled) .
[in] Sound is GRS_NONE, GRS_MESSAGEBEEP, or GRS_WAVFILE.
[in] lpWavFile points to the full path and filename of a .wav file to play.
Notes:
There is no corresponding function to return the current settings for a device. When a scanning
device is opened, the default configuration is for a MessageBeep(0) to be executed on a good
read. Applications will probably want to call ScanSetGoodReadSound() immediately after
successfully opening the scanner with ScanOpenDevice() in the WM_INSERTION message handler,
if the default sound configuration is not desired.
Returns:
SR_SUCCESS
The operation completed successfully.
SR_NOT_INITIALIZED
A successful call to ScanInit() must be made first.
SR_INVALID_SCANNER_HANDLE
The hScanner argument is not a valid scanner handle.
SR_INVALID_SOUND_TYPE
The Sound argument must be GRS_NONE, GRS_MESSAGEBEEP, or GRS_WAVFILE.
SR_WAVFILE_NOT_FOUND
Unable to find the file referenced by the lpWavFile argument.
SR_MEMORY_FAILURE
An internal error occurred, most likely due to unavailable resources on the host device. The device
will probably need to be reset, though the problem may be correctable if the user terminates
other processes on the device and re-tries the operation.
April 8, 2010
Page 36
Document#: 6410-00147 K
Revision 2.28