This article is original. If you need to reprint it, please indicate the source!
The Microsoft SDK provides a mapirule example to show how to intercept text messages.
To filter spam messages or intercept messages of certain numbers, we need to insert a bar in the processmessage function. It is handled based on the sender's phone number (pspvemail-> value. lpszw) or text message content (pspvsubject-> value. lpszw.
After mapirule. dll is compiled, modify the registry. This example also describes:
1) Add an hkey_classes_root/CLSID/{3ab4c10e-673c-494c-98a2-cc2e91a48115/inprocserver32. The default value is mapirule. dll and character type;
2) add an HKEY_LOCAL_MACHINE/software/Microsoft/inbox/svc/SMS/rules. The new key is {3ab4c10e-673c-494c-98a2-cc2e91a48115} and the value is 1 and DWORD.
After the registry is changed, copy mapirule. DLL to the Windows directory. Restart your phone and the interception starts to take effect.
If there is a compilation problem in wm5.0, the README attached to the example is described in detail.