📄 dial.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2475
ClientLeft = 60
ClientTop = 345
ClientWidth = 4110
LinkTopic = "Form1"
ScaleHeight = 2475
ScaleWidth = 4110
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 2160
TabIndex = 3
Top = 1560
Width = 975
End
Begin VB.CommandButton Command1
Caption = "拨号"
Enabled = 0 'False
Height = 495
Left = 600
TabIndex = 2
Top = 1560
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 360
TabIndex = 1
Top = 840
Width = 3375
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "电话话码:"
Height = 180
Left = 360
TabIndex = 0
Top = 480
Width = 900
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'API函数声明
Option Explicit
Private Declare Function tapiRequestMakeCall& Lib "TAPI32.DLL" _
(ByVal destaddress$, ByVal appname$, ByVal calledparty$, ByVal comment$)
Private Const TAPIERR_NOREQUESTRECIPIENT = -2&
Private Const TAPIERR_REQUESTQUEUEFULL = -3&
Private Const TAPIERR_INVALDESTADDRESS = -4&
Private Sub Command1_Click()
Dim buff As String
Dim nresult As Long
nresult = tapiRequestMakeCall&(Trim$(Text1.Text), CStr(Caption), "Test Dial", "")
If nresult <> 0 Then
buff = "拨号错误:"
Select Case nresult
Case TAPIERR_NOREQUESTRECIPIENT
buff = buff & "No Windows Telephony dialing application is running and none could be started."
Case TAPIERR_REQUESTQUEUEFULL
buff = buff & "The queue of pending Windows Telephony dialing requests is full."
Case TAPIERR_INVALDESTADDRESS
buff = buff & "The phone number is not valid"
Case Else
buff = buff & "Unknown error."
End Select
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
End Sub
Private Sub Text1_Change()
Command1.Enabled = Len(Trim$(Text1.Text)) > 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -