⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 record.frm

📁 三汇CTI示例程序源码
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form MainForm 
   ClientHeight    =   5130
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9120
   LinkTopic       =   "Form1"
   ScaleHeight     =   5130
   ScaleWidth      =   9120
   StartUpPosition =   3  'Windows Default
   Begin VB.OptionButton Option1 
      Caption         =   "CodeControl"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   2
      Left            =   2040
      TabIndex        =   10
      Top             =   4200
      Width           =   1695
   End
   Begin VB.OptionButton Option1 
      Caption         =   "VoltageControl"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   1
      Left            =   2040
      TabIndex        =   9
      Top             =   3720
      Width           =   1815
   End
   Begin VB.OptionButton Option1 
      Caption         =   "VoiceControl"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   0
      Left            =   2040
      TabIndex        =   8
      Top             =   3120
      Value           =   -1  'True
      Width           =   1695
   End
   Begin VB.CommandButton StopPlay 
      Caption         =   "StopPlay"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6120
      TabIndex        =   7
      Top             =   3600
      Width           =   940
   End
   Begin VB.CommandButton Play 
      Caption         =   "Play"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6000
      TabIndex        =   6
      Top             =   3000
      Width           =   940
   End
   Begin VB.CommandButton UnSetListen 
      Caption         =   "StopListen"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4560
      TabIndex        =   5
      Top             =   3720
      Width           =   940
   End
   Begin VB.CommandButton SetListen 
      Caption         =   "Listen"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4560
      TabIndex        =   4
      Top             =   3000
      Width           =   940
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   10
      Left            =   3360
      Top             =   0
   End
   Begin VB.CommandButton Command7 
      Cancel          =   -1  'True
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   7560
      TabIndex        =   3
      Top             =   3000
      Width           =   940
   End
   Begin VB.ComboBox Cur_LineCom 
      Height          =   315
      Left            =   960
      TabIndex        =   1
      Text            =   "0"
      Top             =   2760
      Width           =   735
   End
   Begin MSFlexGridLib.MSFlexGrid StateGrid 
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   8895
      _ExtentX        =   15690
      _ExtentY        =   4260
      _Version        =   393216
      AllowUserResizing=   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Times New Roman"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Channel"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   10.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   2835
      Width           =   780
   End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command7_Click()
  Unload Me
End Sub
Private Sub Cur_LineCom_Click()
    Dim CurLine As Integer
    CurLine = Val(Cur_LineCom.Text)
    If ChannelState(CurLine).ConState = SHENGKONG Then Option1(0).Value = True
    If ChannelState(CurLine).ConState = YAKONG Then Option1(1).Value = True
    If ChannelState(CurLine).ConState = MAKONG Then Option1(2).Value = True
End Sub
Private Sub Form_Load()
  Dim I As Integer
  If InitCtiSystem() = False Then
     Unload Me
  Else
     Call InitTrkChannelList
     Call InitChannelState
     ListenChannel = MaxLine
     Timer1.Enabled = True
     For I = 0 To MaxLine - 1
        Cur_LineCom.AddItem (Str(I))
     Next I
  End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
  Call SsmCloseCti
  
End Sub
Private Sub Option1_Click(Index As Integer)
  Dim CurLine As Integer
  CurLine = Val(Cur_LineCom.Text)
  If Index = 0 Then ChannelState(CurLine).ConState = SHENGKONG
  If Index = 1 Then ChannelState(CurLine).ConState = YAKONG
  If Index = 2 Then ChannelState(CurLine).ConState = MAKONG
End Sub
Private Sub Play_Click()
   On Error Resume Next
   Dim szErrMsg As String * 200
   If (SsmPlayFile(0, "test.wav", -1, 0, &HFFFFFFFF)) = -1 Then
   SsmGetLastErrMsg szErrMsg
   MsgBox szErrMsg, vbOKOnly, "Alarm"
   Exit Sub
   End If
End Sub
Private Sub SetListen_Click()
   Dim Cur_Line As Integer
   Cur_Line = Val(Cur_LineCom.Text)
   If ListenChannel = Cur_Line Then
      MsgBox "The channel is set to listening mode!", vbOKOnly, "Error"
   Else
      ChannelState(ListenChannel).ListenState = NoListen
      ChannelState(Cur_Line).ListenState = Listen
      ListenChannel = Cur_Line
   End If
End Sub
Private Sub StopPlay_Click()
   On Error Resume Next
   Dim szErrMsg As String
   If ((SsmCheckPlay(0) = 0) And (SsmStopPlayFile(0) = -1) Or (SsmCheckPlay(0) = -1)) Then
   SsmGetLastErrMsg szErrMsg
   MsgBox szErrMsg, vbOKOnly, "Alarm"
   Exit Sub
   End If
End Sub
Private Sub Timer1_Timer()
    Call ScanChannelState
    Call UpdateChannelState
End Sub
Private Sub UnSetListen_Click()
   On Error Resume Next
   ChannelState(ListenChannel).ListenState = NoListen
   ListenChannel = MaxLine
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -