Hello,
I'm trying to have an auto message reply in Windows Mobile. I'm using MessageInterceptor class which seems to work first time. But it doesn't seems to work for seconds message! not sure if I have to have infinite loop. I don't have a whole lot of experience with Windows Mobile development so please suggest best way.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile;
using Microsoft.WindowsMobile.PocketOutlook;
using Microsoft.WindowsMobile.PocketOutlook.MessageInterception;
namespace TextMessage3
{
public partial class Form1 : Form
{
protected MessageInterceptor smsInterceptor = null;
public Form1()
{
InitializeComponent();
debugTxt.Text = "Calling Form cs";
//Receiving text message
MessageInterceptor interceptor = new MessageInterceptor(InterceptionAction.NotifyandDelete);
interceptor.MessageReceived += SmsInterceptor_MessageReceived;
}
public void SmsInterceptor_MessageReceived(object sender,
MessageInterceptorEventArgs e)
{
SmsMessage msg = new SmsMessage();
msg.To.Add(new Recipient("James", "+16044352345"));
msg.Body = "Congrats, it works!";
msg.Send();
//Receiving text message
MessageInterceptor interceptor = new MessageInterceptor(InterceptionAction.NotifyAndDelete);
interceptor.MessageReceived += SmsInterceptor_MessageReceived;
}
}
}
Thanks,
Tam