richedit

How to correctly handle Windows messages from an MSFTEDIT_CLASS (RichEdit) control?

ぃ、小莉子 提交于 2019-12-13 03:24:42
问题 UPDATE: As requested I have added all of the code I am using to create the Window and its RichEdit control. I'm trying to handle windows messages for a RichEdit control used as a child of another window. Now I did have the RichEdit control working with the exception of my own WndProc . The issue is that, when I set wc.lpszClassName = MSFTEDIT_CLASS; so that it matches lpClassName used in CreateWindowEx() , the content of the RichEdit control no longer appears to draw (ie text, etc), however,

Want to show colored box around Richedit control in MFC at runtime

▼魔方 西西 提交于 2019-12-11 09:43:29
问题 I have an mfc application. I have some richedit controls on the dialog. I want to show a yellow colored filled frame around the controls. What is the way to do this? I tried to create one more rich edit ctrl around the existing richedit ctrl and use SetBackgroundColor on its variable, but it colors the entire area and other richedit ctrls become invisible. Also, I want to change the surrounding color at run time. Please help me. I am stuck with this. 回答1: There may be a better way to

How to test if a control is a RichEdit control

拜拜、爱过 提交于 2019-12-11 01:55:17
问题 Most TWinControl descendant in Delphi has an override method CreateParams to define it's subclass such as: 'EDIT', 'COMBOBOX', 'BUTTON', 'RICHEDIT' and etc. CreateSubClass(Params, 'EDIT'); CreateSubClass(Params, 'COMBOBOX'); CreateSubClass(Params, 'BUTTON'); There are quite a number of rich edit control for Delphi including controls from third party vendors. All those controls are sub class of RichEdit. I am wondering if there is a way to test a control is RichEdit regardless of it's original

Richedit style formatting changes on its own

不羁的心 提交于 2019-12-11 01:35:56
问题 (Someone edit the title if you can understand and define my problem better.) The problem which I am having is with style formatting of a RichEdit "reverting" back to the default "nothing" aka [] and then back to whatever I set it to, bold or italic for example. The thing that is at fault - I assume, since I have no idea how it is breaking things - is a procedure (REMainLinesCheck) that checks for amount of lines in the RichEdit and deletes the first one until a certain point is reached (to

Delphi. Analog of Memo/RichEdit

假装没事ソ 提交于 2019-12-10 22:23:28
问题 Does anybody know if there is an analog of Memo/RichEdit? Demand: to number lines, to load big files (more than 5 MB) from a stream. 回答1: Developer Express have an extensive set of VCL components, among them a Memo replacement (TcxMemo) and a RTF edit (I don't know about the feature set, though). 回答2: TMS Software has a very good TAdvMemo with a lot of syntax highlighters. And also has a TRichEdit "replacement". In addition to the syntax highlighting their memo supports line numbers. Don't

Move TRichEdit Caretpos

纵饮孤独 提交于 2019-12-10 19:57:00
问题 is there a way to change the caret position in pixel? i would like to move the care pos everytime i move the mouse mouse. like: Onmousemove: MoveCaretPos(X, Y); 回答1: No, you cannot set the position of the caret in a specific point, instead you must set the caret in a character position. To do this you must use the EM_CHARFROMPOS message to retrieve the closest character to a specified point and then set the value returned to the SelStart property. Check this sample procedure TForm1

How to autoscroll to the end of RichEdit?

久未见 提交于 2019-12-10 12:48:05
问题 I never needed to use the TRichEdit before, always used TMemo. I'd like RichEdit autoscrolling to the end when I add text like TMemo. See how it looks after you add some data: As you can see, the scroll bar remains at the top, but I'd like it stayed at the bottom as I added text. I've 'googled' for solutions but I couldn't find a good and reliable one. 回答1: Try this code RichEdit1.SetFocus; RichEdit1.SelStart := RichEdit1.GetTextLen; RichEdit1.Perform(EM_SCROLLCARET, 0, 0); 回答2: Here is much

c++ winapi impossible to create 2 controls

北城以北 提交于 2019-12-10 11:59:12
问题 I'm trying to create window that contain richedit control and listbox control, the problem is that the second control which I create, doesn't show up. I mean: case WM_CREATE: // In main window procedure { /* Center the main window */ This->CenterWindow(hwnd); /* Initialize the clients list */ This->InitListClients(hwnd); /* Initialize the server log */ This->InitEditLog(hwnd); return 0; } If InitListClients function will be first, only the listbox will show up, if InitEditLog will be first,

change text color in win32 richedit

风格不统一 提交于 2019-12-10 11:18:33
问题 I want to show different text colors in win32 rich edit control, here' my test #include <windows.h> #include <richedit.h> #include <commctrl.h> HWND console; // util function for rich edit namespace rich_edit { CHARFORMAT get_char_fmt(HWND hwnd, DWORD range = SCF_DEFAULT) { CHARFORMAT cf; SendMessage(hwnd, EM_GETCHARFORMAT, range, (LPARAM)&cf); return cf; } void set_char_fmt(HWND hwnd, const CHARFORMAT& cf, DWORD range = SCF_DEFAULT) { SendMessage(hwnd, EM_SETCHARFORMAT, range, (LPARAM)&cf);

How to change underlining color in a Rich Edit control (Win32/C)

ⅰ亾dé卋堺 提交于 2019-12-09 06:00:52
问题 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); The MSDN documentation doesn’t specify how to change the color of underlines, just the text (with underlines) and