Pelles C forum

Pelles C => Feature requests => Topic started by: John Z on October 29, 2025, 02:45:46 PM

Title: RichEdit 4.1
Post by: John Z on October 29, 2025, 02:45:46 PM
Please consider adding Richedit4.1 to the control tool box in a future version release.
It uses the newer RTF DLL Msftedit.dll.

Calling syntax:
    HWND hwndEdit= CreateWindowEx(0, MSFTEDIT_CLASS, TEXT("Type here"),
        ES_MULTILINE | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP,
        x, y, width, height,
        hwndOwner, NULL, hinst, NULL);

John Z
Title: Re: RichEdit 4.1
Post by: TimoVJL on October 30, 2025, 08:24:08 AM
Meanwhile:
It is possible to add richedit 4.1 to dialog via custom control or add richedit control and change classname to "RichEdit50W"
and LoadLibrary("Msftedit.dll");
Title: Re: RichEdit 4.1
Post by: Vortex on October 30, 2025, 11:43:41 AM
Hi Timo,

We can create an import library for this dll. The Masm64 and Msys2 setups are providing the library.
Title: Re: RichEdit 4.1
Post by: TimoVJL on October 30, 2025, 01:16:15 PM
Sure we can.

Also make just a ref
#pragma comment(lib, "msftedit.lib")
int CALLBACK RichEditANSIWndProc(void);

FARPROC pDll = (FARPROC)RichEditANSIWndProc;   // REExtendedRegisterClass; not in Windows 11

msftedit.def for x86
LIBRARY msftedit.dll
EXPORTS
_IID_IRichEditOle DATA
_IID_IRichEditOleCallback DATA
_IID_ITextServices DATA
_IID_ITextHost DATA
_IID_ITextHost2 DATA
_CreateTextServices@12
_REExtendedRegisterClass@0
_RichEditANSIWndProc@16
_RichEdit10ANSIWndProc@16
_SetCustomTextOutHandlerEx
_DllGetVersion@4
_RichEditWndProc@16
_RichListBoxWndProc@16
_RichComboBoxWndProc@16

msftedit.def for x64
LIBRARY MSFTEDIT.dll
EXPORTS
IID_IRichEditOle DATA
IID_IRichEditOleCallback DATA
IID_ITextServices DATA
IID_ITextHost DATA
IID_ITextHost2 DATA
CreateTextServices
REExtendedRegisterClass
RichEditANSIWndProc
RichEdit10ANSIWndProc
SetCustomTextOutHandlerEx
DllGetVersion
RichEditWndProc
RichListBoxWndProc
RichComboBoxWndProc
Title: Re: RichEdit 4.1
Post by: John Z on November 01, 2025, 11:50:37 AM
Thanks Timo!  👍👍👍

Grabbed them.

I would not be surprised to see Richedit 1 and 2 depreciated in the near future.
Win 11 notepad already uses 4.1.

John Z
Title: Re: RichEdit 4.1
Post by: Vortex on November 01, 2025, 12:11:48 PM
Hi Timo,

In your def file, you don't need the equates :

_CreateTextServices@12=CreateTextServices
This line should be enough :

_CreateTextServices@12
Title: Re: RichEdit 4.1
Post by: TimoVJL on November 01, 2025, 12:24:50 PM
Yes, you are right.
Just an old habit for dll defs.
Title: Re: RichEdit 4.1
Post by: Pelle on November 16, 2025, 06:34:09 PM
I'm not sure how many new classic dialogs are created these days...
...but probably not a big thing, except I sure like to have an even number of buttons in the tool palette.

Also, unless officially deprecated -which I seriously doubt will happen- it's hard to just remove controls that have been there "forever"...

Possibly, but I will have to think about this...
Title: Re: RichEdit 4.1
Post by: John Z on November 16, 2025, 11:02:11 PM
Always good to maintain balance...

Maybe the TOOLTIPS_CLASS could balance the scales.

John Z
Title: Re: RichEdit 4.1
Post by: TimoVJL on November 17, 2025, 11:27:40 AM
If Rich-edit class "RichEdit50W" be option to Rich-edit 2.0 control, no new button needed.
Title: Re: RichEdit 4.1
Post by: Vortex on November 17, 2025, 12:21:36 PM
Hi Timo,

One of the Masm Forum members is using extensively the RichEDit control, maybe we can consult him.
Title: Re: RichEdit 4.1
Post by: Pelle on November 30, 2025, 10:03:50 PM
Apparently there are four versions of Rich Edit:
Version 1.0, Riched32.dll, class "RICHEDIT"
Version 2.0, Riched20.dll, class "RichEdit20A"/"RichEdit20W"
Version 3.0, Riched20.dll, class "RichEdit20A"/"RichEdit20W"
Version 4.1, Msftedit.dll, class "RICHEDIT50W"
Not sure who came up with this, but surely strong medication must have been involved...
The next version of the dialog editor will have four RichEdit controls (1, 2, 3, and 5).
Title: Re: RichEdit 4.1
Post by: John Z on December 01, 2025, 12:05:00 PM
Thanks Pelle,

Balanced definitely... ;)


John Z

Title: Re: RichEdit 4.1
Post by: TimoVJL on December 01, 2025, 12:11:13 PM
Also a "RICHEDIT60W" might be a good option, as there is a free version of dll for downloading.
Some richedit dlls have only some additional COM features.
Windows 10 and 11 have it already ?