richedit

C++ WIN32 - Load RTF Data to Rich Edit Control

百般思念 提交于 2019-12-08 14:29:46
问题 I try to load text (formatting in RTF ) to my rich text control but it doesn't work. I've even tried to use WriteFile((HANDLE)dwCookie, myBuff, cb, (DWORD*)pcb, NULL); instead of *pcb = rtf->readsome((char*)pbBuff, cb); void CreateRichEdit(HWND hwndOwner, int x, int y, int width, int height, HINSTANCE hinst) { LoadLibrary(TEXT("Msftedit.dll")); edittext = CreateWindowEx(0, TEXT("RICHEDIT50W"), TEXT("Type here"), ES_MULTILINE | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP | ES_AUTOVSCROLL |

Delphi: Center Specific Line in TRichEdit by Scrolling

跟風遠走 提交于 2019-12-08 03:12:26
问题 I have a Delphi 2007 TRichEdit with several lines in it. I want to scroll the richedit vertically such that a specific line number if approximately centered in the visible/display area of the richedit. For example, I want to write the code for CenterLineInRichEdit in this example: procedure CenterLineInRichEdit(Edit: TRichEdit; LineNum: Integer); begin ... Edit.ScrollTo(...); end; procedure TForm1.FormCreate(Sender: TObject); var REdit: TRichEdit; i: Integer; begin REdit := TRichEdit.Create

Hiding caret in RichEdit winapi

廉价感情. 提交于 2019-12-07 15:30:38
I would like to hide a caret from a RichEdit(50W) with ES_READONLY style specified. It's pretty confusing for the user, when the caret is blinking and the user can't type. I tried to hide the caret using HideCaret() function, however it doesn't work for me with following code: LRESULT CALLBACK ChatMessaegsSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) // Subclassed control { LRESULT ret = CallWindowProc(WndProc_ChatMessages, hwnd, msg, wParam, lParam); switch(msg) { //Also tried with EN_SETFOCUS case WM_SETFOCUS: { ret = CallWindowProc(WndProc_ChatMessages, hwnd, msg, wParam,

How to implement the mouse click for URLs at rich edit control

℡╲_俬逩灬. 提交于 2019-12-07 07:59:02
问题 I added a read-only rich edit 2.0 control to my dialog (code is using C windows API, the dialog is created by using function DialogBox) At the dialog call back, at the WM_INITDIALOG, I add the following code to enable url detection and also enable the event ENM_LINK is sent to the parent dialog instead of the rich edit control itself: LRESULT mask = SendMessage(hWndText, EM_GETEVENTMASK, 0, 0); //hWndText is rich edit control SendMessage(hWndText, EM_SETEVENTMASK, 0, mask | ENM_LINK); :

Display of Asian characters (with Unicode): Difference in character spacing when presented in a RichEdit control compared with using ExtTextOut

雨燕双飞 提交于 2019-12-07 04:02:46
问题 This picture illustrates my predicament: All of the characters appear to be the same size, but the space between them is different when presented in a RichEdit control compared with when I use ExtTextOut. I would like to present the characters the same as in the RichEdit control (ideally), in order to preserve wrap positions. Can anyone tell me: a) Which is the more correct representation? b) Why the RichEdit control displays the text with no gaps between the Asian Characters? c) Is there any

RichEdit does not process hyperlinks

梦想与她 提交于 2019-12-06 09:56:14
I want my RichEdit to process hyperlinks, so I followed the instructions on: http://delphi.about.com/od/vclusing/l/aa111803a.htm Here are the changes I made to the code: interface type TProgCorner = class(TForm) RichEdit2: TRichEdit; RichEdit1: TRichEdit; RichEdit3: TRichEdit; RichEdit4: TRichEdit; procedure FormCreate(Sender: TObject); private procedure InitRichEditURLDetection(RE: TRichEdit); protected procedure WndProc(var Msg: TMessage); override; end; implementation {$R *.DFM} uses ShellAPI, RichEdit; const AURL_ENABLEURL = 1; AURL_ENABLEEAURLS = 8; procedure TProgCorner

Temporaily disabling the C# Rich Edit undo buffer while performing syntax highlighting

我与影子孤独终老i 提交于 2019-12-06 09:48:19
问题 I already have a pretty decent syntax highlighter in my Rich Edit control but I have one final problem before it is fully useful: Whenever I run the syntax coloring it records those coloring actions in the undo buffer, which I do not really want. Is there any way to temporarily disable recording undo actions so that after a coloring the user can press undo and it will just undo the user's own actions and not the automated syntax highlighter? I don't think I have the time to implement the

contentEditable cursor position/style in FireFox

久未见 提交于 2019-12-06 01:11:05
问题 I'm having trouble using contentEditable in FireFox 3. I have a problem where the cursor will appear above or only partially in the div after I click in it (until I start typing at which time it behaves correctly). Any ideas on how I can stop this from happening? HTML: <html> <head><title>Test Page</title></head> <body> <div id="editor" style="position:absolute; left:157px; top:230px; width:120px; height:30px"> <div id="input" style="width:100%; height:100%; border:1px solid black; outline

Colorful text in the same line in TRichEdit

早过忘川 提交于 2019-12-05 20:03:19
问题 How to write text in the same line but with different color? (I use richedit). procedure TForm1.btnEClick(sender: TObject); begin m0.SelAttributes.Color := clBlue; m0.SelAttributes.Style := [fsBold]; m0.lines.add('This is blue and it is bold'); m0.SelAttributes.Color := clGreen; m0.SelAttributes.Style := [fsBold]; m0.lines.add ('This is Green and it is bold'); m0.lines.add(''); m0.lines.add('But how to write text in the same line with different color?'); // i want to have both blue and green

Why am I getting RichEdit line insertion error when I call Delete in OnChange event?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 18:27:46
I've googled and checked many places for a solution, but all cases I found differed or involved something more advanced than simply adding or deleting lines. Basically, I want to make a sort of scrolling rich edit (alternative would be moving the caret to the bottom, which I already found a solution for). I'm adding lines to it and checking Lines.Count with the OnChange event of the rich edit and as soon as it reaches value greater 15 I want to call Lines.Delete(0) , however I get the error: RichEdit line insertion error Can someone tell me what am I doing wrong here ? You are getting the