User's Manual

Datum // date
10.07.2014
Teile-Nr. // part no.
300011
Dokument-Nr. Revision //
document no. revision
300011AL11E 07
Head Module Settings
User Manual
Seite/gesamt // page/total
24 / 25
Dokument erstellt // document created
SAS387 10.07.2014
Dokument geprüft // document checked
FIH091 10.07.2014
User Manual: Head Module Settings
● Ablageort: C:\Users\de0216\Documents\Quellcode\EcomService\user_manual_head_module_settings\300011AL11E07_user_manual_head_module_settings.docx
template no.: 0730QV06A03 template created: HAO006 20.01.2011 template checked: BEA373 20.01.2011 location: ISO drive
Now all the settings in the registry are done so we can start catching that named events and do
whatever we want if the center scan button is pressed.
Create two events in your application source code by calling the windows function
CreateEvent()” and set the name of the events to the named events at the registry
(“DeltaTriggerEvent” and “StateTriggerEvent”).
HANDLE hDeltaEvent = CreateEvent(NULL, FALSE, FALSE,
TEXT("DeltaTriggerEvent"));
HANDLE hStateEvent = CreateEvent(NULL, FALSE, FALSE,
TEXT("StateTriggerEvent"));
Next step is to wait for the delta event (“DeltaTriggerEvent”). Use the windows function
WaitForSingleObject()” or “WaitForMultipleObjects()” to catch the delta event. If the delta
event is caught you must wait for the state event (“StateTriggerEvent”) to check if the center
scan button is pressed or released.
DWORD dwEvent = WaitForSingleObject (hDeltaEvent, INFINITE);
If(dwEvent == WAIT_OBJECT_0)
{
if(WaitForSingleObject(hStateEvent, 10) == WAIT_OBJECT_0)
{
// center scan button is pressed
}
else
{
// center scan button is released
}
}
Do this in a background thread so that the application won’t blocked while waiting that the
center scan button is pressed. If you do no longer need the event functionality close the event
handle with the windows function “CloseHandle()”.