Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Runtime.InteropServices;
- class Argox
- {
- //SCANAPI
- // WM_APP 0x8000
- public const int WM_APP = 0x8000;
- // WM_PPP 0x90000
- public const int SM_DATA_READY = WM_APP + 1;
- public const int SM_ERROR_SYSTEM = WM_APP + 2;
- public const int SM_ERROR_API = WM_APP + 3;
- // WM_USER 0x0400
- public const int WM_USER = 0x400;
- public const int ERR_WRITE_FAIL = WM_USER + 1;
- public const int ERR_SETTING_FAIL = WM_USER + 2;
- public const int ERR_SCANNER_NOT_OPEN = WM_USER + 3;
- public const int ERR_INVALID_FILE = WM_USER + 4;
- public const int ERR_TIMEOUT = WM_USER + 5;
- public const int ERR_INVALID_SCANNER_VER = WM_USER + 6;
- // BARCODE TYPE
- public const int BC_CODE11 = 100;
- public const int BC_CODE39 = 101;
- public const int BC_CODE93 = 102;
- public const int BC_CODE128 = 103;
- public const int BC_CODABAR = 104;
- public const int BC_EAN8 = 105;
- public const int BC_EAN13 = 106;
- public const int BC_INDUSTRIAL_25 = 107;
- public const int BC_INTERLEAVED_25 = 108;
- public const int BC_STANDARD_25 = 109;
- public const int BC_MSI_PLESSEY = 110;
- public const int BC_UK_PLESSEY = 111;
- public const int BC_TELEPEN = 112;
- public const int BC_UPCA = 113;
- public const int BC_UPCE = 114;
- public const int BC_MATRIX_25 = 115;
- public const int BC_PDF417 = 116;
- public const int BC_CODE16K = 117;
- public const int BC_CHINAPOST = 118;
- public const int BC_RSS14 = 119;
- public const int BC_RSS_LIMITED = 120;
- public const int BC_RSS_EXPANDED = 121;
- public const int BC_PHARMACODE = 122;
- public const int BC_MICOR_PDF = 123;
- public const int BC_EANUCC = 124;
- public struct GeneralSetting
- {
- uint m_uiScanResume;
- uint m_uiLED;
- uint m_uiBeep;
- uint m_uiVibrator;
- uint m_uiPosition;
- uint m_uiTransmit;
- uint m_uiLengthTrans;
- uint m_uiNameTrans;
- uint m_uiConversion;
- uint m_uiConfirm;
- uint m_uiMinLength;
- uint m_uiMaxLength;
- uint m_uiInverte;
- byte[] m_strTerminator;//[22]
- byte[] m_strPreamble;//[22]
- byte[] m_strPostamble;//[22]
- };
- public struct Code11_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2]
- };
- public struct Code39_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiFormat;
- uint m_uiStarEndTrans;
- };
- public struct Code93_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct Code128_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiFormat;
- byte m_cUCCEAN128ID;
- byte m_cConcatenationCode;
- };
- public struct Codabar_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiStartEndType;
- uint m_uiStartEndTrans;
- };
- public struct EAN8_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumTrans;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiSupplement;
- uint m_uiTruncation;
- uint m_uiExpansion;
- };
- public struct EAN13_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumTrans;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiSupplement;
- uint m_uiISBN_ISSN;
- };
- public struct Industrial25_Setting
- {
- uint m_uiRead;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct Interleaved25_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct Standard25_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct MSI_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct UK_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct Telepen_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiFormat;
- };
- public struct UPCA_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumTrans;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiSupplement;
- uint m_uiTruncate;
- };
- public struct UPCE_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumTrans;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiSupplement;
- uint m_uiTruncate;
- uint m_uiExpansion;
- uint m_uiUPCE1;
- };
- public struct Matrix25_Setting
- {
- uint m_uiRead;
- uint m_uiChecksumEnable;
- uint m_uiChecksumTrans;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct ChinaPost_Setting
- {
- uint m_uiRead;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct RSS14_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiUCCEAN128_Emulation;
- };
- public struct RSSLimited_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiUCCEAN128_Emulation;
- };
- public struct RSSExpanded_Setting
- {
- uint m_uiRead;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiUCCEAN128_Emulation;
- };
- public struct Pharmacode_Setting
- {
- uint m_uiRead;
- uint m_uiMaxLen;
- uint m_uiMinLen;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiLeadingA;
- };
- public struct PDF417_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiEscapeTrans;
- };
- public struct Code16K_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- };
- public struct MicroPDF_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiEscapeTrans;
- };
- public struct EANUCC_Setting
- {
- uint m_uiRead;
- uint m_uiTruncateLeading;
- uint m_uiTruncateEnd;
- byte[] m_cID;//[2];
- uint m_uiUCCEAN128Emulation;
- };
- public struct ScannerSetting
- {
- GeneralSetting generalsetting;
- Code11_Setting Code11;
- Code39_Setting Code39;
- Code93_Setting Code93;
- Code128_Setting Code128;
- Codabar_Setting Codabar;
- EAN8_Setting EAN8;
- EAN13_Setting EAN13;
- Industrial25_Setting Indust25;
- Interleaved25_Setting Inter25;
- Standard25_Setting Stand25;
- MSI_Setting MSIPlessey;
- UK_Setting UKPlessey;
- Telepen_Setting Telepen;
- UPCA_Setting UPCA;
- UPCE_Setting UPCE;
- Matrix25_Setting Matrix25;
- ChinaPost_Setting ChinaPost;
- RSS14_Setting Rss14;
- RSSLimited_Setting RssLimited;
- RSSExpanded_Setting RssExpanded;
- Pharmacode_Setting Pharmacode;
- PDF417_Setting PDF417;
- Code16K_Setting Code16K;
- MicroPDF_Setting MicroPDF;
- EANUCC_Setting EANUCC;
- };
- public const uint E_FUNC_ERROR = 0x00000001;
- public const uint E_FUNC_SUCCEED = 0x00000000;
- public struct CONNECT_INFO
- {
- public int nChannel;
- public int nConnectType;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
- public byte[] strCom;
- }
- [DllImport("scanapiax.dll", EntryPoint = "GetLibraryVersion")]
- public static extern int GetLibraryVersion();
- [DllImport("scanapiax.dll", EntryPoint = "API_Register")]
- public static extern bool API_Register(IntPtr hwnd);
- [DllImport("scanapiax.dll", EntryPoint = "API_Register2")]
- public static extern bool API_Register2(IntPtr hHandle, ref int pMessage);
- [DllImport("scanapiax.dll", EntryPoint = "API_Unregister")]
- public static extern void API_Unregister();
- [DllImport("scanapiax.dll", EntryPoint = "API_Reset")]
- public static extern bool API_Reset();
- [DllImport("scanapiax.dll", EntryPoint = "API_GetError")]
- public static extern uint API_GetError();
- [DllImport("scanapiax.dll", EntryPoint = "API_GetSysError")]
- public static extern uint API_GetSysError();
- [DllImport("scanapiax.dll", EntryPoint = "API_GetBarData")]
- public static extern uint API_GetBarData(byte[] buffer, ref uint uiLength, ref uint uiBarType);
- [DllImport("scanapiax.dll", EntryPoint = "API_GetBarDataLength")]
- public static extern uint API_GetBarDataLength();
- [DllImport("scanapiax.dll", EntryPoint = "API_GetBarType")]
- public static extern uint API_GetBarType();
- [DllImport("scanapiax.dll", EntryPoint = "API_ResetBarData")]
- public static extern void API_ResetBarData();
- [DllImport("scanapiax.dll", EntryPoint = "API_GoodRead")]
- public static extern void API_GoodRead();
- [DllImport("scanapiax.dll", EntryPoint = "API_SaveSettingsToScanner")]
- public static extern bool API_SaveSettingsToScanner();
- [DllImport("scanapiax.dll", EntryPoint = "API_SaveSettingsToFile")]
- public static extern bool API_SaveSettingsToFile(string filename);
- [DllImport("scanapiax.dll", EntryPoint = "API_LoadSettingsFromFile")]
- public static extern bool API_LoadSettingsFromFile(string filename);
- [DllImport("scanapiax.dll", EntryPoint = "S2K_IsLoad")]
- public static extern bool S2K_IsLoad();
- [DllImport("scanapiax.dll", EntryPoint = "S2K_Load")]
- public static extern bool S2K_Load(bool bLoad, uint dwTimeOut);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_SendCommand")]
- public static extern bool SCAN_SendCommand(int nCommand1, int nCommand2, byte[] pValue);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_QueryStatus")]
- public static extern bool SCAN_QueryStatus(int nCommand1, int nCommand2, byte[] pReturn);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_BatchSetting")]
- public static extern uint SCAN_BatchSetting(ScannerSetting setting);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_BatchRead")]
- public static extern uint SCAN_BatchRead(ref ScannerSetting ReadBuf);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_EnablePowerOnAlert")]
- public static extern uint SCAN_EnablePowerOnAlert(int nEnable);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_GetPowerOnAlert")]
- public static extern int SCAN_GetPowerOnAlert();
- [DllImport("scanapiax.dll", EntryPoint = "EnableTriggerKey")]
- public static extern uint EnableTriggerKey(bool bEnable);
- [DllImport("scanapiax.dll", EntryPoint = "GetTriggerKeyStatus")]
- public static extern uint GetTriggerKeyStatus();
- [DllImport("scanapiax.dll", EntryPoint = "TriggerStatus")]
- public static extern uint TriggerStatus();
- [DllImport("scanapiax.dll", EntryPoint = "PressTriggerKey")]
- public static extern uint PressTriggerKey(bool bPress);
- [DllImport("scanapiax.dll", EntryPoint = "SCAN_ResumeSystem")]
- public static extern uint SCAN_ResumeSystem(bool bOn);
- [DllImport("scanapiax.dll", EntryPoint = "GetScannerDevice")]
- public static extern uint GetScannerDevice();
- [DllImport("scanapiax.dll", EntryPoint = "PT_OpenScan2Key")]
- public static extern bool PT_OpenScan2Key();
- [DllImport("scanapiax.dll", EntryPoint = "PT_CloseScan2Key")]
- public static extern void PT_CloseScan2Key();
- [DllImport("scanapiax.dll", EntryPoint = "PT_SetToDefault")]
- public static extern int PT_SetToDefault();
- [DllImport("scanapiax.dll", EntryPoint = "PT_EnableScanner")]
- public static extern int PT_EnableScanner();
- [DllImport("scanapiax.dll", EntryPoint = "PT_DisableScanner")]
- public static extern void PT_DisableScanner();
- [DllImport("scanapiax.dll", EntryPoint = "PT_CheckBarcodeData")]
- public static extern bool PT_CheckBarcodeData();
- [DllImport("scanapiax.dll", EntryPoint = "PT_GetBarcodeData")]
- public static extern bool PT_GetBarcodeData(ref uint uiBarType, byte[] pBuffer, ref uint uiMaxBufferLen);
- [DllImport("scanapiax.dll", EntryPoint = "PT_SetDefault")]
- public static extern bool PT_SetDefault();
- //SYSAPI
- // DISPLAY
- [DllImport("sysapiax.dll", EntryPoint = "SetBacklightPWM")]
- public static extern uint SetBacklightPWM(int nACPowerPercent, int nBatteryPercent);
- [DllImport("sysapiax.dll", EntryPoint = "Display_QueryBacklightIntensity")]
- public static extern uint Display_QueryBacklightIntensity(out uint lpdwACBacklight, out uint lpdwBatteryBacklight);
- [DllImport("sysapiax.dll", EntryPoint = "BacklightOn")]
- public static extern uint BacklightOn(bool bOn);
- [DllImport("sysapiax.dll", EntryPoint = "GetBacklightStatus")]
- public static extern uint GetBacklightStatus();
- [DllImport("sysapiax.dll", EntryPoint = "PowerOnLCD")]
- public static extern uint PowerOnLCD(bool bOn);
- // KEYPAD
- [DllImport("sysapiax.dll", EntryPoint = "SendKbdVisualKey")]
- public static extern uint SendKbdVisualKey(byte Key);
- [DllImport("sysapiax.dll", EntryPoint = "SetKeypadAlphaMode")]
- public static extern uint SetKeypadAlphaMode(int nMode);
- [DllImport("sysapiax.dll", EntryPoint = "GetKeypadAlphaMode")]
- public static extern uint GetKeypadAlphaMode();
- [DllImport("sysapiax.dll", EntryPoint = "EnablePowerButton")]
- public static extern uint EnablePowerButton(bool bOn);
- // LED
- [DllImport("sysapiax.dll", EntryPoint = "GoodReadLEDOn")]
- public static extern uint GoodReadLEDOn(bool bOn);
- [DllImport("sysapiax.dll", EntryPoint = "KeypadLEDOn")]
- public static extern uint KeypadLEDOn(bool bOn);
- [DllImport("sysapiax.dll", EntryPoint = "GetKeypadLEDStatus")]
- public static extern bool GetKeypadLEDStatus();
- // BATTERY
- [DllImport("sysapiax.dll", EntryPoint = "GetBatteryStatus")]
- public static extern int GetBatteryStatus();
- // AUDIO
- [DllImport("sysapiax.dll", EntryPoint = "Audio_SetVolume")]
- public static extern uint Audio_SetVolume(uint dwVolume);
- [DllImport("sysapiax.dll", EntryPoint = "Audio_GetVolume")]
- public static extern uint Audio_GetVolume(out uint lpdwVolume);
- // SYSTEM
- [DllImport("sysapiax.dll", EntryPoint = "RegisterAlphaKeyNotification")]
- public static extern uint RegisterAlphaKeyNotification(IntPtr hWnd, uint uMsg);
- [DllImport("sysapiax.dll", EntryPoint = "UnregisterAlphaKeyNotification")]
- public static extern uint UnregisterAlphaKeyNotification(IntPtr hWnd);
- [DllImport("sysapiax.dll", EntryPoint = "EnableAutoConnect")]
- public static extern bool EnableAutoConnect(bool bEnable);
- [DllImport("sysapiax.dll", EntryPoint = "CallSuspend")]
- public static extern void CallSuspend();
- [DllImport("sysapiax.dll", EntryPoint = "ShowTaskbar")]
- public static extern bool ShowTaskbar(bool bShow);
- [DllImport("sysapiax.dll", EntryPoint = "ShowDesktop")]
- public static extern bool ShowDesktop(bool bShow);
- [DllImport("sysapiax.dll", EntryPoint = "ShowExploreToolbar")]
- public static extern bool ShowExploreToolbar(bool bShow);
- [DllImport("sysapiax.dll", EntryPoint = "ShowChineseIME")]
- public static extern bool ShowChineseIME(bool bShow);
- //BLUETOOTH
- [DllImport("SYSAPIAX.dll", EntryPoint = "BT_On")]
- public static extern int BT_On();
- [DllImport("SYSAPIAX.dll", EntryPoint = "BT_Off")]
- public static extern void BT_Off();
- [DllImport("SYSAPIAX.dll", EntryPoint = "PairDevice")]
- public static extern int PairDevice(ulong btAddress, byte[] PinCode);
- [DllImport("SYSAPIAX.dll", EntryPoint = "UnPairDevice")]
- public static extern int UnPairDevice(ulong btAddress);
- [DllImport("SYSAPIAX.dll", EntryPoint = "InitSearchBTDevice")]
- public static extern int InitSearchBTDevice(ref int hLookup);
- [DllImport("SYSAPIAX.dll", EntryPoint = "FindNextBTDevice")]
- public static extern int FindNextBTDevice(int hLookup, StringBuilder szDeviceName, ref ulong btAddress, int nNameLen);
- [DllImport("SYSAPIAX.dll", EntryPoint = "EndSearchBTDevice")]
- public static extern int EndSearchBTDevice(int hLookup);
- [DllImport("SYSAPIAX.dll", EntryPoint = "ConnectDevice")]
- public static extern int ConnectDevice(ulong btAddress, ref CONNECT_INFO Info, bool nConnect);
- [DllImport("SYSAPIAX.dll", EntryPoint = "GetConnectStatus", CharSet=CharSet.Unicode)]
- public static extern int GetConnectStatus(ulong btAddress, int nConnectType, String pCom, ref int nStatus);
- [DllImport("SYSAPIAX.dll", EntryPoint = "GetSPPClientChannel")]
- public static extern int GetSPPClientChannel(ulong btAddress, ref int nChannel);
- //WLAN
- [DllImport("sysapiax.dll", EntryPoint = "WL_Enable")]
- public static extern bool WL_Enable();
- [DllImport("sysapiax.dll", EntryPoint = "WL_Disable")]
- public static extern bool WL_Disable();
- // VIBRATOR
- [DllImport("sysapiax.dll", EntryPoint = "VibratorOn")]
- public static extern uint VibratorOn(bool bOn);
- }"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement