ALL,
是否可以获得程序使用的 RichEdit 控件的版本?
| 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 实现。他们是完全不同的。后者添加了很多东西。
如果我加载了Msftedit.dll
,有些功能在 7.5 版本中是不可用的(例如自动拼写检查)。
甚至有可能同一进程可以加载所有三个 DLL,甚至可以在同一进程中使用所有三个版本的 RichEdit:
-
"RICHEDIT"
→ 1.0
-
"RichEdit20W"
→ 2.0、3.0
-
"RICHEDIT50"
→ 4.1、7.5、8.5
给定一个 RichEdit 控件(例如 WinForms富文本框 https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.richtextbox?view=netframework-4.7.2, WPF 富文本框 https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.richtextbox?view=netframework-4.7.2, WinRT 富编辑框 https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.RichEditBox, VCL TRich编辑 http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/ComCtrls_TRichEdit.html) 有没有办法确定 RichEdit 控件的版本?
或者也许我可以通过可用的 Windows 版本以某种方式区分它们?