protected override void WndProc(ref Message msg) { switch (msg.Msg) { case WM_GET_BARCODE: { int len = 0; uint type = 0; if ((len = USI_API.USI_GetDataLength()) > 0) { byte[] buff = new byte[len]; USI_API.USI_ReadOK(); USI_API.USI_GetData(buff, len, ref type); // v1.03 UTX_Answer ÐÞ¸Ä (2D >> ÏÔʾºº×Ö) //string barcodeString = System.Text.Encoding.ASCII.GetString(bBuff, 0, bBuff.Length); string barcodeString = System.Text.Encoding.Default.GetString(buff, 0, buff.Length); ////todo.. //if(totalcount==1) //barcodeString = "00123456001"; //else if(totalcount ==2) // barcodeString = "00123456002"; //else if (totalcount == 3) // barcodeString = "00123456003"; //else if (totalcount == 4) // barcodeString = "00123456004"; //else if (totalcount == 5) // barcodeString = "00123456005"; //totalcount++; barcodeScanner.DoGetBarcode(barcodeString); } } break; } // call the base class WndProc for default message handling base.WndProc(ref msg); }
/// <summary> /// ¹Ø±Õ Scanner /// </summary> /// <returns></returns> public bool Close() { return(USI_API.USI_EnableScan(false)); }
/// <summary> /// ¿ªÆô Scanner /// </summary> public bool Open() { return(USI_API.USI_EnableScan(true)); }
public void Unregister() { USI_API.USI_Unregister(); }
public void Register() { USI_API.USI_Register(scanMessageWindow.Hwnd, ScannerMessageWindow.WM_GET_BARCODE); }
private Scanner() { scanMessageWindow = new ScannerMessageWindow(this); USI_API.USI_Register(scanMessageWindow.Hwnd, ScannerMessageWindow.WM_GET_BARCODE); }