VERSION 5.00
Object = "{69AED762-6FDE-48FD-880E-89C5AAB0AEF2}#1.0#0"; "FKGPRS.ocx"
Begin VB.Form frmMain 
   BackColor       =   &H00C0FFC0&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Main Menu"
   ClientHeight    =   8115
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8100
   FillColor       =   &H008080FF&
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   541
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   540
   StartUpPosition =   2  'CenterScreen
   Begin VB.TextBox txtIPAddress 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2130
      TabIndex        =   21
      Text            =   "192.168.0.9"
      Top             =   2160
      Width           =   1830
   End
   Begin VB.TextBox txtPortNo 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2130
      TabIndex        =   20
      Text            =   "5005"
      Top             =   2685
      Width           =   855
   End
   Begin VB.TextBox txtPassword 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2130
      TabIndex        =   19
      Text            =   "0"
      Top             =   3255
      Width           =   855
   End
   Begin VB.TextBox txtTimeOut 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2130
      TabIndex        =   18
      Text            =   "5000"
      Top             =   3825
      Width           =   855
   End
   Begin VB.TextBox txtPCPort 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   2130
      TabIndex        =   17
      Text            =   "7005"
      Top             =   4425
      Width           =   915
   End
   Begin FKRealGPRSLib.FKRealGPRS FKRealGPRS 
      Height          =   480
      Left            =   1200
      TabIndex        =   16
      Top             =   720
      Width           =   480
      _Version        =   65536
      _ExtentX        =   847
      _ExtentY        =   847
      _StockProps     =   0
   End
   Begin VB.CommandButton cmdSystemInfo 
      Caption         =   "System Info Management"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4345
      TabIndex        =   15
      Top             =   3948
      Width           =   3420
   End
   Begin VB.CommandButton cmdLogData 
      Caption         =   "Log Data Management"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4340
      TabIndex        =   14
      Top             =   3292
      Width           =   3420
   End
   Begin VB.CommandButton cmdEnrollData 
      Caption         =   "Enroll Data Management"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4335
      TabIndex        =   13
      Top             =   2636
      Width           =   3420
   End
   Begin VB.CommandButton cmdProuctData 
      Caption         =   "Get Product Data"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4330
      TabIndex        =   12
      Top             =   4604
      Width           =   3420
   End
   Begin VB.CommandButton cmdBellInfo 
      Caption         =   "Bell Time"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4325
      TabIndex        =   11
      Top             =   5260
      Width           =   3420
   End
   Begin VB.CommandButton cmdUserInfo 
      Caption         =   "Set UserInfo"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4320
      TabIndex        =   10
      Top             =   5916
      Width           =   3420
   End
   Begin VB.CommandButton cmdOpenComm 
      Caption         =   "Open Comm"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4320
      TabIndex        =   9
      Top             =   1980
      Width           =   1650
   End
   Begin VB.CommandButton cmdCloseComm 
      Caption         =   "Close Comm"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   6090
      TabIndex        =   8
      Top             =   1980
      Width           =   1650
   End
   Begin VB.CommandButton cmdSetPassTime 
      Caption         =   "Set PassTime"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4350
      TabIndex        =   7
      Top             =   6572
      Width           =   3420
   End
   Begin VB.CommandButton cmdAdjustInfo 
      Caption         =   "Set Adjust Info"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   540
      Left            =   4350
      TabIndex        =   6
      Top             =   7230
      Width           =   3420
   End
   Begin VB.TextBox txtLicense 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   5760
      TabIndex        =   4
      Text            =   "0"
      Top             =   1380
      Width           =   840
   End
   Begin VB.TextBox txtMachineNumber 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   3120
      TabIndex        =   3
      Text            =   "1"
      Top             =   1380
      Width           =   600
   End
   Begin VB.Label lblPassword 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Password :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   480
      TabIndex        =   27
      Top             =   3315
      Width           =   1650
   End
   Begin VB.Label lblTimeOut 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "TimeOut :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   480
      TabIndex        =   26
      Top             =   3885
      Width           =   1650
   End
   Begin VB.Label lblPCPort 
      BackStyle       =   0  'Transparent
      Caption         =   "Server Port :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   480
      TabIndex        =   25
      Top             =   4470
      Width           =   1650
   End
   Begin VB.Label lblIPAddress 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "IP Address :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   480
      TabIndex        =   24
      Top             =   2220
      Width           =   1650
   End
   Begin VB.Label lblPortNo 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Port Number :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   480
      TabIndex        =   23
      Top             =   2745
      Width           =   1650
   End
   Begin VB.Label lblTimeOutT 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "(ms)"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3090
      TabIndex        =   22
      Top             =   3870
      Width           =   555
   End
   Begin VB.Label lblComLicense 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "License :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   4800
      TabIndex        =   5
      Top             =   1440
      Width           =   810
   End
   Begin VB.Label lblMachineNumber 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Machine Number :"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1320
      TabIndex        =   2
      Top             =   1440
      Width           =   1710
   End
   Begin VB.Label lblVer 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "FKGPRS.ocx (Ver 2.52)"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   330
      Left            =   0
      TabIndex        =   1
      Top             =   810
      Width           =   8040
   End
   Begin VB.Label lbSubject 
      Alignment       =   2  'Center
      BackColor       =   &H80000013&
      BackStyle       =   0  'Transparent
      Caption         =   "FingerKeeper Sample"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   20.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   480
      Left            =   0
      TabIndex        =   0
      Top             =   180
      Width           =   8040
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public gbOpenFlag As Boolean
Public gbConnectFlag As Boolean

Private Sub FKRealGPRS_OnReceiveIPaddr(ByVal astrDeviceIP As String, ByVal anDevicePort As Long, ByVal vnDeviceID As Long)
    Dim vnLicense As Long
    Dim vRet As Long
    txtIPAddress.Text = astrDeviceIP
    txtPortNo.Text = anDevicePort
    vnLicense = Val(Trim(txtLicense.Text))
    If gbConnectFlag = False Then
        vRet = FKRealGPRS.ConnectProc(vnLicense)
        If vRet = 1 Then gbConnectFlag = True
        OwnerEnableButtons gbConnectFlag
    End If
End Sub

Private Sub Form_Load()
    OwnerEnableButtons False
    gbOpenFlag = False
    txtMachineNumber.Text = "1"
    gbConnectFlag = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
    cmdCloseComm_Click
    gbConnectFlag = False
    End
End Sub

Private Sub cmdOpenComm_Click()
    Dim vnMachineNumber As Long
    Dim vnLicense As Long
    Dim vpszNetPassword As Long
    Dim vnTimeOut As Long
    Dim vnProtocolType As Long
    Dim vnResultCode As Long
    Dim vpszPCPort As Long
    
    
    cmdOpenComm.Enabled = False
    vnMachineNumber = Val(txtMachineNumber.Text)
    vnLicense = Val(txtLicense.Text)
    vpszPCPort = Val(Trim(txtPCPort.Text))
    vnResultCode = FKRealGPRS.OpenNetwork(vpszPCPort)
    If vnResultCode = RUN_SUCCESS Then
        gbOpenFlag = True
        'OwnerEnableButtons True
    Else
        MsgBox ReturnResultPrint(vnResultCode), vbOKOnly, "error"
        cmdOpenComm.Enabled = True
    End If
End Sub

Private Sub cmdCloseComm_Click()
    Dim vpszPCPort As Long
    If gbOpenFlag = True Then
        vpszPCPort = Val(Trim(txtPCPort.Text))
        FKRealGPRS.CloseNetwork (vpszPCPort)
        gbOpenFlag = False
        gbConnectFlag = False
        OwnerEnableButtons False
    End If
End Sub
'
Private Sub cmdEnrollData_Click()
    Me.Visible = False
    frmEnroll.Visible = True
End Sub

Private Sub cmdLogData_Click()
    Me.Visible = False
    frmLog.Visible = True
End Sub

Private Sub cmdSystemInfo_Click()
    Me.Visible = False
    frmSystemInfo.Visible = True
End Sub

Private Sub cmdProuctData_Click()
    Me.Visible = False
    frmProductData.Visible = True
End Sub

Private Sub cmdBellInfo_Click()
    Me.Visible = False
    frmBellInfo.Visible = True
End Sub

Private Sub cmdUserInfo_Click()
    Me.Visible = False
    frmUserInfo.Visible = True
End Sub

Private Sub cmdSetPassTime_Click()
    Me.Visible = False
    frmPassTimeInfo.Visible = True
End Sub

Private Sub cmdAdjustInfo_Click()
    Me.Visible = False
    frmAdjust.Visible = True
End Sub

Private Sub OwnerEnableButtons(abEnableFlag As Boolean)
    cmdOpenComm.Enabled = Not abEnableFlag
    cmdCloseComm.Enabled = abEnableFlag
    cmdSystemInfo.Enabled = abEnableFlag
    cmdProuctData.Enabled = abEnableFlag
    cmdBellInfo.Enabled = abEnableFlag
    cmdUserInfo.Enabled = abEnableFlag
    cmdSetPassTime.Enabled = abEnableFlag
    cmdAdjustInfo.Enabled = abEnableFlag
End Sub
