📄 frmmain.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain
Caption = "telmate_v6_demo"
ClientHeight = 7785
ClientLeft = 60
ClientTop = 450
ClientWidth = 8325
LinkTopic = "Form1"
ScaleHeight = 7785
ScaleWidth = 8325
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton hangupctrl
Caption = "系统挂机"
Height = 495
Left = 1800
TabIndex = 2
Top = 2400
Width = 1455
End
Begin VB.CommandButton offhookctrl
Caption = "系统摘机"
Height = 495
Left = 240
TabIndex = 1
Top = 2400
Width = 1455
End
Begin MSComDlg.CommonDialog FileDlg
Left = 7200
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Timer Timer1
Interval = 50
Left = 7800
Top = 120
End
Begin VB.ListBox lstMessage
Height = 1815
Left = 120
TabIndex = 0
Top = 120
Width = 8055
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private bOpen As Boolean
Private e As TEvent
Private nPlayDevID As Long
Private nRecDevID As Long
Private Sub ShowMsg(msg As String)
lstMessage.AddItem msg
End Sub
Private Sub OpenDevice()
If TV_Initialize() Then
ShowMsg "初始化设备成功"
bOpen = True
Else
ShowMsg "初始化设备失败"
bOpen = False
End If
End Sub
Private Sub ReOpenDevice()
End Sub
Private Sub CloseDevice()
' If bOpen Then
TV_Disable
ShowMsg "设备已关闭"
bOpen = False
' End If
End Sub
Private Sub offhook()
If bOpen Then
TV_OffHookCtrl (0)
Sleep 500 ' 摘机时间,可调节
ShowMsg "摘机"
Else
ShowMsg "设备没打开"
End If
End Sub
Private Sub hangup()
If bOpen Then
TV_HangUpCtrl (0)
ShowMsg "挂机"
Else
ShowMsg "设备没打开"
End If
End Sub
Private Sub Dial(num As String, ByVal speed As Integer)
End Sub
Private Sub StopDial()
End Sub
Private Sub cboSpeed_Change()
End Sub
Private Sub closemic_Click()
End Sub
Private Sub cmdDial_Click()
End Sub
Private Sub cmdPlayFile_Click()
' Dim nDevID As Integer
End Sub
Private Sub cmdSaveFile_Click()
End Sub
Private Sub disabletel_Click()
End Sub
Private Sub enabletel_Click()
End Sub
Private Sub Form_Load()
OpenDevice ' 打开设备
End Sub
Private Sub Form_Unload(Cancel As Integer)
CloseDevice ' 关闭设备
End Sub
Private Sub cmdReinit_Click()
ReOpenDevice
End Sub
Private Sub hangupctrl_Click()
TV_HangUpCtrl (0)
End Sub
Private Sub offhookctrl_Click()
TV_OffHookCtrl (0)
End Sub
Private Sub openmic_Click()
End Sub
Private Sub Timer1_Timer()
'If TV_GetEvent(CHN, e) > 0 Then
If TV_GetEvent(0, e) > 0 Then
Select Case e.EventType
Case TEvent_GetDTMF: '接收来电号码
ShowMsg (e.Data.buf)
Case TEvent_GetFsk:
ShowMsg (e.Data.buf)
Case TEvent_MicIn:
ShowMsg ("麦克风插入")
Case TEvent_MicOut:
ShowMsg ("麦克风拔出")
Case TEvent_OffHook:
ShowMsg ("呼叫方摘机")
Case TEvent_Ring:
ShowMsg ("来电响铃")
Case TEvent_DialEnd:
ShowMsg ("拨号结束")
Case TEvent_Busy:
ShowMsg ("忙音")
Case TEvent_PlayEnd:
ShowMsg ("播放完毕")
Case TEvent_HangUp:
ShowMsg ("对方挂机")
Case TEvent_InterHangUp:
ShowMsg ("本地话机挂机")
Case TEvent_InterOffHook:
ShowMsg ("本地话机摘机")
Case TEvent_Nobody:
ShowMsg ("无人接听")
Case TEvent_GetChar: '通话中接收按键号码
ShowMsg ("取得DTMF码 " + e.Data.buf)
Case TEvent_GetInterChar:
ShowMsg ("本地话机拨号")
Case TEvent_TelCallOut:
ShowMsg ("本地话机拨号后听到回铃")
End Select
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -