I have always wanted to write something about custom form and transport, but on the one hand, there are many things, and I can't finish either of them. On the other hand, I feel that there are not many people to use, it is also a white write, so it has never been started. Recently, many netizens mentioned the use of custom form through mail or on csdn forums (mainly to implement their own clients such as MMS ), here I will briefly introduce how to use custom form, and hope to help anyone who needs it.
In fact, Microsoft's 2005 SDK sample already has a more detailed example called customform, you can find this example in the SDK installation directory/wce500/Windows Mobile 5.0 Pocket pc sdk/samples/CPP/Win32, So I skipped the detailed code, let's start with the call logic of the system for a custom form.
1. the user clicks new or an existing message to edit it. tmail checks the corresponding message type, for example, IPM. smstext (SMS) or IPM. note (Outlook Email) or another, and then query the Registry Message Type registration location (HKEY_CURRENT_USER/software/Microsoft/inbox/msgtypes/IPM) to find the correct form DLL.
2. Each form dll must implement the formfactoryex output function. tmail calls formfactoryex to obtain the iformproviderex object.
3. call different functions of iformproviderex according to different requirements. For example, if you create a new function or edit a message, iformproviderex: createcomposeform is called. If you play a video, iformproviderex: createreadform is called, to obtain the message icon, call iformproviderex: getmsgstatusiconindex (refer to the article "easily change the message icon of Pocket PC & smartphone ).
You need to implement your own editing client. What if you can easily create your defined message? This is not involved in Microsoft's sample. The process is as follows:
1. Intercept the EMS message through imailruleclient and change its message type to IPM. smstext. sdkems.
2. During editing or playback, because the type is IPM. smstext. sdkems, the registered EMS custom form will be called.
It skips the details of creating messages of the IPM. smstext. sdkems type. How do I create messages of this type? One convenient method is to add EMS support on the basis of SMS, such:
In this way, once you click EMS, you can create a custom EMS message. to implement it, we can create a message type, such as IPM, based on the customform example. EMS, replace all IPM in customform. smstext. sdkems, next we only need to make a few changes to the registry:
The registration of IPM. EMS type is as follows:
[HKEY_CURRENT_USER/software/Microsoft/inbox/msgtypes/IPM/EMS]
"Glyphinfo" = HEX :/
, 02 ,/
, 00, 00
"DLL" = "emsviewerform. dll"
"Name" =" EMS "
Add a key value under [HKEY_LOCAL_MACHINE/software/Microsoft/inbox/svc/SMS/msgclasses:
"IPM. EMS" = DWORD: 00000001
OK. The separate EMS editor is successful. Let's briefly introduce it here and continue later. Thank you!
Bored customer (blog.csdn.net/yzx0023)
2006-9-18
Yzx0023@gmail.com