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
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");
Hi Timo,
We can create an import library for this dll. The Masm64 and Msys2 setups are providing the library.
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
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
Hi Timo,
In your def file, you don't need the equates :
_CreateTextServices@12=CreateTextServices
This line should be enough :
_CreateTextServices@12
Yes, you are right.
Just an old habit for dll defs.
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...
Always good to maintain balance...
Maybe the TOOLTIPS_CLASS could balance the scales.
John Z
If Rich-edit class "RichEdit50W" be option to Rich-edit 2.0 control, no new button needed.
Hi Timo,
One of the Masm Forum members is using extensively the RichEDit control, maybe we can consult him.
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).
Thanks Pelle,
Balanced definitely... ;)
John Z
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 ?