?? autodial.frm
字號:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "電話撥號上網"
ClientHeight = 1830
ClientLeft = 3765
ClientTop = 3720
ClientWidth = 3510
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 1830
ScaleWidth = 3510
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmdExit
Caption = "退出(&x)"
Height = 375
Left = 1920
TabIndex = 3
Top = 1200
Width = 1215
End
Begin VB.CommandButton cmdDial
Caption = "撥號(&D)..."
Height = 375
Left = 360
TabIndex = 2
Top = 1200
Width = 1215
End
Begin VB.TextBox txtNumber
Height = 285
Left = 120
TabIndex = 0
Top = 600
Width = 3255
End
Begin VB.Label Label1
Caption = "電話號碼:"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
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 cmdDial_Click()
Dim buff As String
Dim nResult As Long
nResult = tapiRequestMakeCall&(Trim$(txtNumber), CStr(Caption), "Test Dial", "")
If nResult <> 0 Then
buff = "撥號錯誤 : "
' 顯示出錯信息
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
buff = buff & "沒有Windows撥號程序運行或無法打開撥號程序."
Case TAPIERR_REQUESTQUEUEFULL
buff = buff & "未完成的Windows撥號程序隊列已滿."
Case TAPIERR_INVALDESTADDRESS
buff = buff & "無效電話號碼."
Case Else
buff = buff & "未知錯誤."
End Select
MsgBox buff
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
EnableDial
End Sub
Private Sub txtNumber_Change()
EnableDial
End Sub
Private Sub EnableDial()
cmdDial.Enabled = Len(Trim$(txtNumber)) > 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -