Attribute VB_Name = "modCSDJ"
Option Explicit

'---------------------------
'
'---------------------------
Public Const USERS232CLASS = 0
Public Const USECOMMLIB = 1
Public Const USESERIALPORTCONTROL = 2
'---------------------------
'
'---------------------------
Public Const MAX_RETRY_COUNT = 3
'---------------------------
'MODE
'---------------------------
Public Const ST_IDLE = 0
Public Const ST_WAIT = 1

'---------------------------
'MODE
'---------------------------
Public Const ST_SET = 11
Public Const ST_STR = 13
Public Const ST_MDM = 21
Public Const ST_MOR = 23
Public Const ST_MOT = 25
Public Const ST_BSY1 = 27
Public Const ST_TGA = 28
Public Const ST_JOG = 31
Public Const ST_SVR1 = 32
Public Const ST_TAT = 41
Public Const ST_TOK = 42
Public Const ST_TMN = 43
Public Const ST_SVR2 = 51
Public Const ST_STP = 61
Public Const ST_MOV = 71
Public Const ST_MOP = 72
Public Const ST_ORG = 81
Public Const ST_STS = 91
Public Const ST_RST = 101
Public Const ST_POS = 111
Public Const ST_VER = 121
Public Const ST_TST = 131
Public Const ST_DAO = 141
Public Const ST_EHY = 151
Public Const ST_BSY2 = 161
Public Const ST_ETC = 171
Public Const ST_ESC = 181
Public Const ST_TYP = 191

'---------------------------
'Define ASCII Value
'---------------------------
Public Const asciiNUL = &H0
Public Const asciiSOH = &H1
Public Const asciiSTX = &H2
Public Const asciiETX = &H3
Public Const asciiEOT = &H4
Public Const asciiENQ = &H5
Public Const asciiACK = &H6
Public Const asciiBEL = &H7
Public Const asciiBS = &H8
Public Const asciiHT = &H9
Public Const asciiLF = &HA
Public Const asciiVT = &HB
Public Const asciiFF = &HC
Public Const asciiCR = &HD
Public Const asciiSO = &HE
Public Const asciiSI = &HF
Public Const asciiDLE = &H10
Public Const asciiDC1 = &H11
Public Const asciiDC2 = &H12
Public Const asciiDC3 = &H13
Public Const asciiDC4 = &H14
Public Const asciiNAK = &H15
Public Const asciiSYN = &H16
Public Const asciiETB = &H17
Public Const asciiCAN = &H18
Public Const asciiEM = &H19
Public Const asciiSUB = &H1A
Public Const asciiESC = &H1B
Public Const asciiFS = &H1C
Public Const asciiGS = &H1D
Public Const asciiRS = &H1E
Public Const asciiUS = &H1F
Public Const asciiSPACE = &H20
'----------------------------------------------------------
Public Const FLAG_COMMAND = 255
Public Const FLAG_NULL = asciiNUL
Public Const FLAG_US = asciiUS
Public Const FLAG_RS = asciiRS
Public Const FLAG_BEL = asciiBEL
Public Const FLAG_ETB = asciiETB

'------------------------------------
'
'------------------------------------
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Declare Function ChildWindowFromPoint Lib "user32" (ByVal hWnd As Long, ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Declare Function SleepEx Lib "kernel32" (ByVal dwMilliseconds As Long, ByVal bAlertable As Long) As Long
Public Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long

'------------------------------------
'
'------------------------------------
Public Type POINTAPI
          x As Long
          y As Long
End Type

