Beispiel #1
0
        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);
        }
Beispiel #2
0
 /// <summary>
 /// ¹Ø±Õ Scanner
 /// </summary>
 /// <returns></returns>
 public bool Close()
 {
     return(USI_API.USI_EnableScan(false));
 }
Beispiel #3
0
 /// <summary>
 /// ¿ªÆô Scanner
 /// </summary>
 public bool Open()
 {
     return(USI_API.USI_EnableScan(true));
 }
Beispiel #4
0
 public void Unregister()
 {
     USI_API.USI_Unregister();
 }
Beispiel #5
0
 public void Register()
 {
     USI_API.USI_Register(scanMessageWindow.Hwnd, ScannerMessageWindow.WM_GET_BARCODE);
 }
Beispiel #6
0
 private Scanner()
 {
     scanMessageWindow = new ScannerMessageWindow(this);
     USI_API.USI_Register(scanMessageWindow.Hwnd, ScannerMessageWindow.WM_GET_BARCODE);
 }