📄 form1.frm
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "mscomm32.ocx"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "短信网关"
ClientHeight = 5655
ClientLeft = 45
ClientTop = 435
ClientWidth = 8160
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5655
ScaleWidth = 8160
StartUpPosition = 2 'CenterScreen
Begin VB.Timer Timer1
Left = 840
Top = 5400
End
Begin VB.PictureBox Pic1
Height = 615
Left = 7320
Picture = "Form1.frx":030A
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 18
Top = 5400
Visible = 0 'False
Width = 615
End
Begin VB.CommandButton CRun
Caption = "系统运行(R)"
Height = 375
Left = 2520
TabIndex = 16
Top = 3960
Width = 1200
End
Begin VB.Frame Frame2
Caption = "信息提示(MSG)"
Height = 615
Left = 240
TabIndex = 15
Top = 4680
Width = 7695
Begin VB.Label msg
ForeColor = &H000000C0&
Height = 255
Left = 120
TabIndex = 17
Top = 240
Width = 7455
End
End
Begin VB.CommandButton Cancel
Caption = "取消操作(C)"
Height = 375
Left = 6480
TabIndex = 10
Top = 3960
Width = 1200
End
Begin VB.CommandButton CRecv
Caption = "接收(R)"
Height = 375
Left = 5880
TabIndex = 9
Top = 5400
Visible = 0 'False
Width = 1000
End
Begin VB.CommandButton CSend
Caption = "发送测试(T)"
Height = 375
Left = 4680
TabIndex = 8
Top = 3960
Width = 1200
End
Begin VB.CommandButton CSetup
Caption = "串口设置(S)"
Height = 375
Left = 480
TabIndex = 7
Top = 3960
Width = 1200
End
Begin VB.Frame Frame1
Height = 4335
Left = 240
TabIndex = 0
Top = 240
Width = 7695
Begin VB.TextBox tPhone
Height = 315
Left = 5270
TabIndex = 14
Top = 280
Width = 2200
End
Begin VB.TextBox tCenter
Height = 315
Left = 1440
TabIndex = 12
Text = "+8613800571500"
Top = 280
Width = 2200
End
Begin VB.ComboBox ComBand
Height = 315
Left = 240
TabIndex = 6
Top = 3000
Width = 1000
End
Begin VB.TextBox txtRecv
Height = 1215
Left = 1440
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 2160
Width = 6015
End
Begin VB.TextBox txtSend
Height = 1215
Left = 1440
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 840
Width = 6015
End
Begin VB.ComboBox ComPort
Height = 315
Left = 240
TabIndex = 2
Top = 2520
Width = 1000
End
Begin VB.Label LenTxt
ForeColor = &H00000080&
Height = 225
Left = 240
TabIndex = 19
Top = 1320
Width = 1150
End
Begin VB.Label Label4
Caption = "对方号码(D):"
Height = 255
Left = 4000
TabIndex = 13
Top = 285
Width = 1150
End
Begin VB.Label Label3
Caption = "服务中心(N):"
Height = 255
Left = 260
TabIndex = 11
Top = 280
Width = 1150
End
Begin VB.Label Label2
Caption = "短信内容(C):"
Height = 255
Left = 240
TabIndex = 4
Top = 840
Width = 1150
End
Begin VB.Label Label1
Caption = "串口选择(S):"
Height = 255
Left = 240
TabIndex = 1
Top = 2160
Width = 1150
End
End
Begin MSCommLib.MSComm MSComm1
Left = 120
Top = 5400
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.Menu menufile
Caption = "file"
Visible = 0 'False
Begin VB.Menu open
Caption = "打开(O)"
End
Begin VB.Menu Reg
Caption = "注册(R)"
End
Begin VB.Menu About
Caption = "关于(A)"
End
Begin VB.Menu exit
Caption = "退出(E)"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const WM_MOUSEMOVE = &H200
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Const WM_RBUTTONDBLCLK = &H206
Private Const WM_RBUTTONDOWN = &H204
Private Const WM_RBUTTONUP = &H205
Private Type NOTIFYICONDATA
cbSize As Long
mhWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Dim TheForm As NOTIFYICONDATA
Public Function SysTray()
TheForm.cbSize = Len(TheForm)
TheForm.mhWnd = Pic1.hWnd
TheForm.hIcon = Pic1.Picture
TheForm.uId = 1&
TheForm.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
TheForm.ucallbackMessage = WM_MOUSEMOVE
TheForm.szTip = "短信网关程序正在运行中..." & Chr$(0)
Shell_NotifyIcon NIM_ADD, TheForm
End Function
Private Sub About_Click()
frmAbout.Show
DoEvents
End Sub
Private Sub CRecv_Click()
MSComm1.Output = "AT+CMGF=1" + Chr(13)
ModuleDo.TimeDelay (100)
If InStr(MSComm1.Input, "OK") > 0 Then
MsgBox "okok"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -