📄 form1.vb
字号:
Imports Microsoft.WindowsMobile.PocketOutlook
Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception
Imports Microsoft.WindowsMobile.Telephony
Public Class Form1
Private mi As MessageInterceptor
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'setup the sms interceptor
If MessageInterceptor.IsApplicationLauncherEnabled("Chapter9") Then
'load existing settings
Me.mi = New MessageInterceptor("Chapter9")
Else
'setup rule and register with application id "Chapter9"
Me.mi = New MessageInterceptor(InterceptionAction.NotifyAndDelete)
Me.mi.MessageCondition = New MessageCondition(MessageProperty.Body, MessagePropertyComparisonType.StartsWith, "Chapter9")
Dim appPath As String = System.Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase
Me.mi.EnableApplicationLauncher("Chapter9", appPath)
End If
AddHandler Me.mi.MessageReceived, New MessageInterceptorEventHandler(AddressOf Me.mi_MessageReceived)
End Sub
Private Sub mi_MessageReceived(ByVal sender As Object, ByVal e As MessageInterceptorEventArgs)
MessageBox.Show(DirectCast(e.Message, SmsMessage).Body, "SMS Received")
End Sub
Private Sub mnuCall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCall.Click
Dim p As New Phone()
p.Talk(Me.txtNumber.Text, True)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -