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 RichTextBox,WPF RichTextBox,WinRT RichEditBox,VCL TRichEdit)有没有办法确定RichEdit控件的版本?
或许我可以通过Windows版本将它们区分开来?
答案 0 :(得分:0)
如果使用c++,您可能会发现以下片段对于读取类名很有用:
TCHAR className[MAX_PATH];
GetClassName(GetRichEditCtrl().GetSafeHwnd(), className, _countof(className));
GetRichEditCtrl()
是另一个控件上的函数,您可能需要用为您提供hwnd
的控件替代。
另一种方法是使用 spy ++ 之类的工具来检查类名。