如何改变一个丰富的编辑控制,强调色彩的(Win32 / C) [英] How to change underlining color in a Rich Edit control (Win32/C)

查看:354
本文介绍了如何改变一个丰富的编辑控制,强调色彩的(Win32 / C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法,使红色丰富的编辑控件(我使用的是4.1版本Msftedit.dll)波浪下划线。我能够产生波浪与此code强调:

I’m looking for a way to make red squiggly underlining in a Rich Edit control (I’m using version 4.1 with Msftedit.dll). I’m able to produce squiggly underlining with this code :

CHARFORMAT2 format;
format.cbSize = sizeof(format);
format.dwMask = CFM_UNDERLINETYPE;
format.bUnderlineType = CFU_UNDERLINEWAVE;
SendMessage(hWndEdit,EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format);

MSDN文档不指定如何改变下划线的颜色,只是文本(带下划线)和文本背景。我已经发现了一些code,说使用低四位为下划线类型(CFU_UNDERLINEWAVE)和上一个颜色。所以,我已经试过:

The MSDN documentation doesn’t specify how to change the color of underlines, just the text (with underlines) and the text background. I’ve found some code that says to use the lower nibble for the underline type (CFU_UNDERLINEWAVE) and the upper one for color. So I’ve tried :

format.bUnderlineType = CFU_UNDERLINEWAVE | 0x50;

但是,这并不正常工作。

But that doesn't work.

更新

我测试过这个code版本3.0(Riched20.dll文件),它的工作。所以,问题的关键在于4.1。是功能删除或移到别处?

I've tested this code with version 3.0 (Riched20.dll) and it's working. So the problem lies in 4.1. Was the feature removed or moved elsewhere ?

这不是在6版(由2007年的办公室使用的DLL)也在努力。

It's not working in version 6 (the dll used by office 2007) also.

推荐答案

我很抱歉这样说,但如果改变下划线的颜色不是由微软文档,你不应该使用它。无证功能这样受到在以后的版本,这可能发生在这里被删除。

I'm sorry to say this, but if changing the color of the underline is not documented by Microsoft you should not use it. Undocumented featured like this are subject to be removed in later versions, which might have happened here.

您最好的选择是要求微软。

Your best bet is to ask Microsoft.

这篇关于如何改变一个丰富的编辑控制,强调色彩的(Win32 / C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆