SMS Message Intercpeption

G

Guest

I'm using Visual Studio 2005, and the .Net 2.0 Framework to intercept an sms
message. When I deploy the solution to a Windows mobile 5 phone, the sms
message interception does not work, any message sent end up directly in the
inbox. What do I need to do to make this work?

Here's the code.


Private WithEvents msgInterceptor As MessageInterceptor


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

msgInterceptor = New
MessageInterceptor(InterceptionAction.NotifyAndDelete, True)

msgInterceptor.MessageCondition = New
MessageCondition(MessageProperty.Body,
MessagePropertyComparisonType.StartsWith, "?", True)

AddHandler msgInterceptor.MessageReceived, AddressOf
smsInterceptor_MessageReceived

End Sub

Private Sub smsInterceptor_MessageReceived(ByVal sender As Object, ByVal
e As MessageInterceptorEventArgs)

Dim message As Microsoft.WindowsMobile.PocketOutlook.SmsMessage =
CType(e.Message, Microsoft.WindowsMobile.PocketOutlook.SmsMessage)

MessageBox.Show(message.Body)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top