The main windproc message handler can have these 2 entries:
// on create of the window
case
WM_CREATE:
Socket ScanAPI Reference
{
Global.hWnd=hWnd;
SKTRESULT Result=SktScanOpen(NULL,&Global.hScanAPI);
if(!SKTSUCCESS(Result))
else
{
}
}
break;
case
WM_TIMER:
TimerHandler();
break;
void
TimerHandler()
{
TSktScanObject* pScanObj=NULL;
bool
bTerminate=false;
SKTRESULT Result=SktScanWait(Global.hScanAPI,&pScanObj,100);
if(SKTSUCCESS(Result))
{
if(Result==ESKT_NOERROR)
{
switch(pScanObj->Msg.MsgID)
{
case
case
case
case
case
case
}
SktScanRelease(Global.hScanAPI,pScanObj);
if(bTerminate==true)
{
}
}
}
}
© 2013 Socket Mobile, Inc.
DisplayError("Unable to Open
// start the timer to consume ScanAPI ScanObject
SetTimer(hWnd,TIMER_ID,200,NULL);
kSktScanMsgIdDeviceArrival:
HandleDeviceArrival(pScanObj);
break;
kSktScanMsgIdDeviceRemoval:
HandleDeviceRemoval(pScanObj);
break;
kSktScanMsgEvent:
HandleAsynchronousEvent(pScanObj);
break;
kSktScanMsgGetComplete:
HandleGetComplete(pScanObj);
break;
kSktScanMsgSetComplete:
HandleSetComplete(pScanObj);
break;
kSktScanMsgIdTerminate:
KillTimer(Global.hWnd,TIMER_ID);// stop the timer
bTerminate=true;// terminate this application
break;
SktScanClose(Global.hScanAPI);
Global.hScanAPI=NULL;
PostMessage(Global.hWnd,WM_CLOSE,0,0);// close this application
ScanAPI:%d",Result);
133/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?