获取丰富的编辑库版本 [英] Get version of rich edit library
问题描述
全部,
是否可以获取程序使用的RichEdit控件的版本?
Is it possible to get the version of the RichEdit control the program uses?
| Version | Class name | Library | Shipped with | New features
|------------|---------------|--------------|-----------------|
| 1.0 | "RICHEDIT" | Riched32.dll | Windows 95 |
| 2.0 | "RichEdit20W" | Riched20.dll | Windows 98 | ITextDocument
| 3.0 | "RichEdit20W" | Riched20.dll | Windows 2000 | ITextDocument2
| 3.1 | "RichEdit20W" | Riched20.dll | Server 2003 |
| 4.1 | "RICHEDIT50" | Msftedit.dll | Windows XP SP1 | tomApplyTmp
| 7.5 | "RICHEDIT50" | Msftedit.dll | Windows 8 | ITextDocument2 (new), ITextDocument2Old, Spell checking, Ink support, Office Math
| 8.5 | "RICHEDIT50" | Msftedit.dll | Windows 10 | LocaleName, more image formats
我知道我可以拥有一些变量,如果 Msftedit.dll
库是否已加载。但是,如果确实加载 RichEd20.dll
,则可以得到RichEdit 2或RichEdit 3的实现。他们是完全不同的。
I know I can just have some variable and assign it appropriately if Msftedit.dll
library is loaded or not. However if I do load RichEd20.dll
, I can get either RichEdit 2 or RichEdit 3 implementation. And they are quite different. A lot of stuff were added in the latter.
如果我确实加载了 Msftedit.dll
,则有些功能7.5在早期版本(例如自动拼写检查)中将不可用。
If i did load Msftedit.dll
, there are features that 7.5 that would not be available in earlier versions (e.g. automatic spell checking).
同一进程甚至可能加载了所有三个DLL,甚至使用了这三个DLL。版本的RichEdit在相同的过程中:
It's even possible that the same process can have all three DLLs loaded, and even using all three versions of RichEdit in the same process:
-
RICHEDIT
→ 1.0 -
RichEdit20W
→ 2.0,3.0 -
RICHEDIT50
→ 4.1、7.5、8.5
"RICHEDIT"
→ 1.0"RichEdit20W"
→ 2.0, 3.0"RICHEDIT50"
→ 4.1, 7.5, 8.5
给出RichEdit控件(例如WinForms RichTextBox ,WPF RichTextBox ,WinRT RichEditBox ,VCL TRichEdit )是否可以确定RichEdit控件的版本?
Given a RichEdit control (e.g. WinForms RichTextBox, WPF RichTextBox, WinRT RichEditBox, VCL TRichEdit) is there a way to determine the version of a RichEdit control?
或者我可以通过可用的Windows版本以某种方式区分它们吗?
Or maybe I can somehow differentiate them by Windows version where it is available?
推荐答案
如果使用 c ++ 的概念,您可能会发现以下代码段对于读取类名非常有用:
If using c++ you may find the following snippet useful to read out the class name :
TCHAR className[MAX_PATH];
GetClassName(GetRichEditCtrl().GetSafeHwnd(), className, _countof(className));
GetRichEditCtrl()
是另一个控件上的函数,您可能需要替换为控件 hwnd
的任何东西。
GetRichEditCtrl()
is function on another control, you may need to substitute with whatever gives you a hwnd
to the control.
另一种方法是使用工具例如 spy ++ 来检查类名。
Another method is using a tool like spy++ to inspect the class name.
这篇关于获取丰富的编辑库版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!