8.4
S
CAN
C
LOSE
D
EVICE
()
Prototype:
SCAN_RESULT ScanCloseDevice (HANDLE hScanner);
Purpose:
Closes the scanner port and releases resources.
Arguments:
[in] hScanner is the value received by the client application in lParam of the WM_REMOVAL
message specified when ScanInit() was called.
If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner
disabled) .
Notes:
A scanner must be closed if the user removes it during your program’s execution. Typically a client
program will call ScanCloseDevice() as part of the message handler of the WM_REMOVAL message.
All open scanners are closed automatically when the ScanDeinit() function is called.
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.
April 8, 2010
Page 25
Document#: 6410-00147 K
Revision 2.28