News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How does RichEdit2 absorb Unicode?

Started by Larry Hammick, July 10, 2005, 05:30:51 PM

Previous topic - Next topic

Larry Hammick

Is there a way to stream Unicode text into a Richedit 2.0 control? That control normally takes 8-bit data from a file or the keyboard but it can also render (for example) Arabic right-to-left text that has been copied and pasted from another application. How does it do that, anybody know? This instruction

invoke SendMessage,hEdit,EM_SETTEXTMODE, \
   TM_PLAINTEXT or TM_MULTICODEPAGE,0

(where hEdit is the handle of the Richedit control) doesn't seem to be enough.
Thanks all.

Larry Hammick

Never mind, folks, I found what I was missing. In the EM_STREAMIN message, a flag called SF_UNICODE (=10h) is needed, e.g.
invoke SendMessage,hEdit,EM_STREAMIN, \
  SF_TEXT or SF_UNICODE,ADDR MyEditStreamStructure