Event Handling for SMS

  • Thread starter Thread starter Wrecked
  • Start date Start date
W

Wrecked

Hello,
I have an application that reads any incoming SMS msg and checks
if its from a particular number, if it is, it will do some process and
doesnt put this msg into the inbox, however if the msg is not from the
particular number, it simply sends it to the phone inbox. This works
perfectly when ever the application is running. The problem is when the
application is not running. How can i cause the program to start
everytime an SMS arrives and do the above process and close. Can i
somehow capture the SMS arrival event. Any pointers on how to do this??

Thanks and Regards,
Rithesh,
MTech Student,
IIIT Bangalore.
 
Depends what you are using to do the interception. If you are using the
MessageInterceptor in the WM5.0 managed APIs use EnableApplicationLauncher
method to register your application. If you are using a native
IMailRuleClient dll you can launch your app within your own code.

Peter
 
Hi, if you want to process incoming SMS anytime you must create a pocket pc
service ( http://www.pocketpcdn.com/articles/services.html ). I have resolved
my problem in this way.

If you avoid to create a service ( I recommend to create a service!! because
number of processes in Windows CE is limited by 32) you can read this for
more way to run a background application when WinCE start.

http://msdn.microsoft.com/windowsmo.../library/en-us/dnppcgen/html/ppc_services.asp

I hope this help you!

Azzi Stefano
 
Hello Peter,
My application is currently on PPC 2003 and i am using IMailRuleClient
to capture the SMS, could kindly elaborate on how can i launch the
application from within the code itself.

Thanks and regards,
Rithesh

MTech Student,
IIIT Bangalore
 
Within your IMailRuleClient C++ dll, you can call CreateProcess with the
path of your application, during the ProcessMessage method. If your app is
already running it will be activated, otherwise it will be started.

Peter
 
Hello Peter,
Thanks for your response. Currently what i am doing is based
on the following link -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/
dnnetcomp/html/ReceivingSMSMessages.asp?frame=true
The implementation is very similar to the one give in the example in
that page. Briefly what i do is
i call the below function
UnmanagedAPI.CaptureSMSMessages();
and then in a seperate thread i continuously pool to check if any
message from a particular no has arrived or not using
UnmanagedAPI.SMSMessageAvailable(sbSms, sbPhoneNr);
and then i process the message which is returned by the above
function.

I create this thread at the start of my program and hence it keeps
polling for the messages..

Getting back to your suggestion could broadly let me know how i could
incorporate what you said. My knowledge of evc++ is not very good.

Thanks and regards,

Rithesh

MTech Student,
IIIT Bangalore.
 
Back
Top