首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Windows Mobile >

能否获得短消息的处理权解决思路

2012-01-21 
能否获得短消息的处理权在windowmobile中能否在系统获得短消息之后,获得短信的处理权,处理完之后(例如来电

能否获得短消息的处理权
在window   mobile中能否在系统获得短消息之后,获得短信的处理权,处理完之后(例如来电防火墙之类)再决定是否抛给上层界面

[解决办法]
wm5 可能可以



[解决办法]
使用MessageInterceptor对象。以下是接收短信息的vb代码
Imports Microsoft.WindowsMobile.Telephony
Imports Microsoft.WindowsMobile.PocketOutlook
Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception
Imports Microsoft.WindowsMobile

Private _SMSCatcher As MessageInterceptor = New MessageInterceptor(InterceptionAction.NotifyAndDelete, True)
Private _SMSFilter As MessageCondition = New MessageCondition()

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'接收短信代码
Dim mi As New Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptor
mi = New MessageInterceptor
AddHandler mi.MessageReceived, AddressOf mi_MessageReceived
'--------------
End Sub

Private Sub mi_MessageReceived(ByVal sender As Object, ByVal e As Microsoft.WindowsMobile.PocketOutlook.MessageInterception.MessageInterceptorEventArgs)
Dim mySMS As SmsMessage = CType(e.Message, SmsMessage)
TextBox1.Text = mySMS.Body '短信息内容
End Sub

短信过滤则设置MessageCondition属性即可。
[解决办法]
SDK例子里面有啊,叫Mapirule,主要使用MailRuleClient

热点排行