The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Larry Hammick on July 10, 2005, 05:30:51 PM

Title: How does RichEdit2 absorb Unicode?
Post by: Larry Hammick on July 10, 2005, 05:30:51 PM
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.
Title: Re: How does RichEdit2 absorb Unicode?
Post by: Larry Hammick on July 10, 2005, 05:59:06 PM
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