I have a C/C++ Windows Mobile 6.5 application that continuously runs on the phone. It needs to analyze the SMSes. How can I be notified in my application about an incoming SMS? I read in MSDN about the SmsSetMessageNotification() but this is starting an application once the SMS comes in, and in my c开发者_如何转开发ase the application is already running, it just needs to be informed that a new SMS was received and then should have access to it in order to analize it and to decide if it's of any interest for the application or not.
So how can my already running application be informed about an incoming SMS which then needs to be analyzed?
I believe you need to use the IMailRuleClient to sign up for notifications of a text message being received.
There is a sample application as part of the sdk that demonstrates this functionality. You can download it from MSDN Code Samples
You can achieve your goal using the Radio Interface Layer (RIL) API. Download RIL.H to get started. Then use LoadLibrary and GetProcAddress to dynamically call the RIL functions from the DLL at runtime. You can setup a RIL notification callback to notify you when message activity happens. I found a code example here.
精彩评论