Re: riched20a with ES_READONLY - can still change formatting ?

"R.Wieser" <[email protected]> Thu, 26 Mar 2026 10:28:08 +0100
Newsgroups comp.os.ms-windows.programmer.win32,alt.comp.os.windows-xp,alt.windows7.general
Organization A noiseless patient Spider
Message-ID <[email protected]>
JJ,

> ES_READONLY works fine in both rich-edit and plain-text mode.

Why ?   Why are you saying that (without any kind of explanation) when I 
just described how it *doesn't* "work fine" ? :-(

> Did SetWindowLong() actually succeeded?

As mentioned, I included the style when defining the control (in the 
programs resource-file).

Also, a rich-text box has a EM_SETREADONLY message available.

https://learn.microsoft.com/en-us/windows/win32/controls/em-setreadonly

(Remarkably, it says /absolutily nothing/ about why it should be used 
instead of just changing the GWL_STYLE bit)

Thanks for reminding me though : I've tested sending that message, but alas, 
the effect remains the same : I can't edit the text, but can still edit the 
formatting (even add bullet-points!).

> Did the style actually been applied?

Well, as mentioned I can't edit the text itself anymore, which indicates to 
me that it has.

But as it so happens I just tested it using GetWindowLong().  It was.

Regards,
Rudy Wieser