Easy Dictation support for Windowless RichEdit controls

In my article in MSDN, I mention that there are some easy ways to enable dictation support in controls that don't normally support dictation.  All the methods I described assume that the control has a window.  There is a way to enable dictation support for windowless rich text edit controls, assuming that you are using the RichEdit 4.1 implementation of ITextServices

I did not include this method in my article because I didn't want to include all the details about ITextServices, how you get an instance, and so forth.  I assume that if you already have an existing windowless rich edit control that uses ITextServices, you already know all that.  (If you don't, there's a quick primer available at CodeProject; note that I haven't actually used this code, and cannot vouch for it.)

Anyway, if you have an ITextServices interface pointer, then you can enable TSF support (and, by extension, dictation support), by calling ITextServices::TxSendMessage(EM_SETEDITSTYLE, SES_USECTF, SES_USECTF).

I hope that more richedit users will enable TSF support, so that users will have an easier time using dictation.