Displaying reply or forward forms with MailComposeMessage and CreateComposeForm

4 views
Skip to first unread message

jo...@navitas.net.nz

unread,
Jan 6, 2008, 10:23:32 PM1/6/08
to
Hi,

(I earlier posted this on the MSDN Smart Devices forum before noticing
their sticky pointing to this group for WM API questions.)

As has been discussed here a few times, in WM5 and WM6 there is no
published API to let the user create a new message which is replying
to an existing one. There is MailComposeMessage() which creates a new,
empty message, but nothing for Reply, Reply All or Forward operations.
 
Although the MAILCOMPOSEFIELDS param of MailComposeMessage lets us pre-
fill To, CC, Subject and Body, this is not the same as a reply
generated by tmail.exe. Particularly when replying to an Exchange
message where the body of the email hasn't been downloaded and is
replied/forwarded by the server instead of the device.
 
On WM5 Pocket PCs I have solved this as follows:
 
- One of the fields of MAILCOMPOSEFIELDS is the message class. This
tells tmail which IFormProviderEx plugin to use to create the compose
form. For the built in classes (email and SMS) this plugin is loaded
from htmlnote.dll. (As defined in HKCU\Software\Microsoft\Inbox
\MsgTypes).

- By registering a new class ("IPM.Fake", say) I can now call
MailComposeMessage() and have tmail invoke my own FormFactoryEx (e.g.
"FakePlugin.dll").

- I use this IFormProviderEx to proxy the actual plugin. I can use the
other MAILCOMPOSEFIELDS fields to give useful information to my fake
IFormProviderEx::CreateComposeForm. Information like the ENTRYID of
the message I'd like to reply to, which message class it should be,
etc.

- Inside this CreateComposeForm I open the message being replied to or
forwarded and pass that to the *actual* CreateComposeForm in
htmlnote.dll, along with changing the requested form type to reply or
forward.

- This trick of proxying the correct IFormProviderEx plugin and
passing the reply-to message as the real plug-ins pMsgBase parameter
works well in WM5. It also works for other non-MS providers (like the
MMS transport on HTC devices for example).

After all that background... here's my problem:

This trick doesn't work on WM6 Professional.
 
Well, it does work for plugins that aren't in htmlnote.dll. So, the
reply/forward mechanism still works fine for MMS on my phone, with the
correct reply/forward forms being displayed and populated. However,
something I am doing in the proxy is upsetting tmail.exe or
htmlnote.dll leading to it only displaying the compose-new form,
despite me invoking CreateComposeForm for the correct class with a
formtype of FORMTYPE_REPLY, FORMTYPE_FORWARD etc.
 
I realise this is not necessarily how the MailComposeMessage() and
form provider APIs were intended to be used, however in the absence of
any other way to let the user reply to a message in the same form
they'd see if they tapped 'reply' in tmail.exe it seems like a
reasonable option.
 
Is anyone at MS able to clarify what's changed in the interaction of
tmail and the htmlnote plugins when invoked via the
MailComposeMessage() function? The fact that this still works fine for
other non-MS transports suggests that what I'm after is still
possible.
 
Or, have I made this way too complicated and can someone tell me the
easy way to display an Exchange-friendly reply form from an
application that isn't tmail.exe?
 
Any thoughts greatly appreciated.
 
Cheers,

--
John Manktelow

Mendu

unread,
Aug 5, 2011, 6:27:41 AM8/5/11
to
" By registering a new class ("IPM.Fake", say) I can now call
MailComposeMessage() and have tmail invoke my own FormFactoryEx "
Can you please tell me what did you mean in the above statement.
Can anyone help me to find out how the FormfactoryEx is Invoked.
I have tried the sample in sdk, but there is no change in any functionality.
Thanks in advance!

> On Wednesday, January 09, 2008 7:11 AM joh wrote:

> Hi,
>
> (I earlier posted this on the MSDN Smart Devices forum before noticing
> their sticky pointing to this group for WM API questions.)
>
> As has been discussed here a few times, in WM5 and WM6 there is no
> published API to let the user create a new message which is replying
> to an existing one. There is MailComposeMessage() which creates a new,
> empty message, but nothing for Reply, Reply All or Forward operations.

> =C2=A0


> Although the MAILCOMPOSEFIELDS param of MailComposeMessage lets us pre-
> fill To, CC, Subject and Body, this is not the same as a reply
> generated by tmail.exe. Particularly when replying to an Exchange
> message where the body of the email hasn't been downloaded and is
> replied/forwarded by the server instead of the device.

> =C2=A0


> On WM5 Pocket PCs I have solved this as follows:

> =C2=A0


> - One of the fields of MAILCOMPOSEFIELDS is the message class. This
> tells tmail which IFormProviderEx plugin to use to create the compose
> form. For the built in classes (email and SMS) this plugin is loaded
> from htmlnote.dll. (As defined in HKCU\Software\Microsoft\Inbox
> \MsgTypes).
>
> - By registering a new class ("IPM.Fake", say) I can now call
> MailComposeMessage() and have tmail invoke my own FormFactoryEx (e.g.
> "FakePlugin.dll").
>
> - I use this IFormProviderEx to proxy the actual plugin. I can use the
> other MAILCOMPOSEFIELDS fields to give useful information to my fake
> IFormProviderEx::CreateComposeForm. Information like the ENTRYID of
> the message I'd like to reply to, which message class it should be,
> etc.
>
> - Inside this CreateComposeForm I open the message being replied to or
> forwarded and pass that to the *actual* CreateComposeForm in
> htmlnote.dll, along with changing the requested form type to reply or
> forward.
>
> - This trick of proxying the correct IFormProviderEx plugin and
> passing the reply-to message as the real plug-ins pMsgBase parameter
> works well in WM5. It also works for other non-MS providers (like the
> MMS transport on HTC devices for example).

> =E2=80=A8After all that background... here's my problem:
> =E2=80=A8This trick doesn't work on WM6 Professional.
> =C2=A0


> Well, it does work for plugins that aren't in htmlnote.dll. So, the
> reply/forward mechanism still works fine for MMS on my phone, with the
> correct reply/forward forms being displayed and populated. However,
> something I am doing in the proxy is upsetting tmail.exe or
> htmlnote.dll leading to it only displaying the compose-new form,
> despite me invoking CreateComposeForm for the correct class with a
> formtype of FORMTYPE_REPLY, FORMTYPE_FORWARD etc.

> =C2=A0


> I realise this is not necessarily how the MailComposeMessage() and
> form provider APIs were intended to be used, however in the absence of
> any other way to let the user reply to a message in the same form
> they'd see if they tapped 'reply' in tmail.exe it seems like a
> reasonable option.

> =C2=A0


> Is anyone at MS able to clarify what's changed in the interaction of
> tmail and the htmlnote plugins when invoked via the
> MailComposeMessage() function? The fact that this still works fine for
> other non-MS transports suggests that what I'm after is still
> possible.

> =C2=A0


> Or, have I made this way too complicated and can someone tell me the
> easy way to display an Exchange-friendly reply form from an
> application that isn't tmail.exe?

> =C2=A0
> Any thoughts greatly appreciated.
> =C2=A0
> Cheers,
>
> --
> John Manktelow

Mendu

unread,
Aug 5, 2011, 6:30:30 AM8/5/11
to
How is the function FormfactoryEx invoked.
I have tried the sample in windows sdk for the same but it
doesnot show any difference in behaviour.
Thanks in advance for your help

> On Wednesday, January 09, 2008 7:11 AM joh wrote:

> Hi,
>
> (I earlier posted this on the MSDN Smart Devices forum before noticing
> their sticky pointing to this group for WM API questions.)
>
> As has been discussed here a few times, in WM5 and WM6 there is no
> published API to let the user create a new message which is replying
> to an existing one. There is MailComposeMessage() which creates a new,
> empty message, but nothing for Reply, Reply All or Forward operations.

> =C2=A0


> Although the MAILCOMPOSEFIELDS param of MailComposeMessage lets us pre-
> fill To, CC, Subject and Body, this is not the same as a reply
> generated by tmail.exe. Particularly when replying to an Exchange
> message where the body of the email hasn't been downloaded and is
> replied/forwarded by the server instead of the device.

> =C2=A0


> On WM5 Pocket PCs I have solved this as follows:

> =C2=A0


> - One of the fields of MAILCOMPOSEFIELDS is the message class. This
> tells tmail which IFormProviderEx plugin to use to create the compose
> form. For the built in classes (email and SMS) this plugin is loaded
> from htmlnote.dll. (As defined in HKCU\Software\Microsoft\Inbox
> \MsgTypes).
>
> - By registering a new class ("IPM.Fake", say) I can now call
> MailComposeMessage() and have tmail invoke my own FormFactoryEx (e.g.
> "FakePlugin.dll").
>
> - I use this IFormProviderEx to proxy the actual plugin. I can use the
> other MAILCOMPOSEFIELDS fields to give useful information to my fake
> IFormProviderEx::CreateComposeForm. Information like the ENTRYID of
> the message I'd like to reply to, which message class it should be,
> etc.
>
> - Inside this CreateComposeForm I open the message being replied to or
> forwarded and pass that to the *actual* CreateComposeForm in
> htmlnote.dll, along with changing the requested form type to reply or
> forward.
>
> - This trick of proxying the correct IFormProviderEx plugin and
> passing the reply-to message as the real plug-ins pMsgBase parameter
> works well in WM5. It also works for other non-MS providers (like the
> MMS transport on HTC devices for example).

> =E2=80=A8After all that background... here's my problem:
> =E2=80=A8This trick doesn't work on WM6 Professional.
> =C2=A0


> Well, it does work for plugins that aren't in htmlnote.dll. So, the
> reply/forward mechanism still works fine for MMS on my phone, with the
> correct reply/forward forms being displayed and populated. However,
> something I am doing in the proxy is upsetting tmail.exe or
> htmlnote.dll leading to it only displaying the compose-new form,
> despite me invoking CreateComposeForm for the correct class with a
> formtype of FORMTYPE_REPLY, FORMTYPE_FORWARD etc.

> =C2=A0


> I realise this is not necessarily how the MailComposeMessage() and
> form provider APIs were intended to be used, however in the absence of
> any other way to let the user reply to a message in the same form
> they'd see if they tapped 'reply' in tmail.exe it seems like a
> reasonable option.

> =C2=A0


> Is anyone at MS able to clarify what's changed in the interaction of
> tmail and the htmlnote plugins when invoked via the
> MailComposeMessage() function? The fact that this still works fine for
> other non-MS transports suggests that what I'm after is still
> possible.

> =C2=A0


> Or, have I made this way too complicated and can someone tell me the
> easy way to display an Exchange-friendly reply form from an
> application that isn't tmail.exe?

> =C2=A0
> Any thoughts greatly appreciated.
> =C2=A0
> Cheers,
>
> --
> John Manktelow


>> On Friday, August 05, 2011 6:27 AM Mendu wrote:

>> " By registering a new class ("IPM.Fake", say) I can now call
>>
>> MailComposeMessage() and have tmail invoke my own FormFactoryEx "
>>

Reply all
Reply to author
Forward
0 new messages