日期:2014-05-16 浏览次数:20737 次
DateTime? lastScanTime = null;
protected override void WndProc(ref Message msg)
{
try
{
if (lastScanTime == null)
{
lastScanTime = DateTime.Now;
}
else
{
TimeSpan span = DateTime.Now - lastScanTime.Value;
if (span.Seconds < 10)
return;
}
if (msg.Msg == WM_SCANCODE_ENGINE_NOTIFY) // BarCode的自定义消息通知
{
uint nDataLen = 0; //= (int)msg.WParam;
uint nBarCodeType = 0;// = (uint)msg.LParam;
byte[] BarCodeData;
barcode.GetBarCodeReaderRes(ref nBarCodeType, ref nDataLen, null);
if (nDataLen > 0)
{
&nbs