// ScanAPI Helper provides a series of Callbacks
        // indicating some asynchronous events has occurred
        #region ScanApiHelperNotification Members

        // a scanner has connected to the host
        public void OnDeviceArrival(long result, ScanApiHelper.DeviceInfo newDevice)
        {
            if (SktScanErrors.SKTSUCCESS(result))
            {
                UpdateStatusText("New Scanner: " + newDevice.Name);
                _device = newDevice;
// This is for the Host Acknowledgment feature. These lines can
// be safely removed from #if to the #endif from your application
// if this feature is not needed
#if HOSTACK
                // Set the device to NOT acknowledge itself
                _scanApiHelper.PostSetLocalAcknowledgement(_device, false, null);
                // And make sure it does not give any indication after a scan
                _scanApiHelper.PostSetDecodeAction(_device, ISktScanProperty.values.localDecodeAction.kSktScanLocalDecodeActionNone, null);
#else
                // Set the device to NOT acknowledge itself
                _scanApiHelper.PostSetLocalAcknowledgement(_device, true, null);
                // And make sure it does not give any indication after a scan
                int decode = ISktScanProperty.values.localDecodeAction.kSktScanLocalDecodeActionBeep |
                             ISktScanProperty.values.localDecodeAction.kSktScanLocalDecodeActionFlash |
                             ISktScanProperty.values.localDecodeAction.kSktScanLocalDecodeActionRumble;
                _scanApiHelper.PostSetDecodeAction(_device, decode, null);
#endif
            }
            else
            {
                string strMsg = String.Format("Unable to open scanner, error = {0}.", result);
                MessageBox.Show(strMsg, strAppName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }