richedit

How to disable Drag/drop TRichEdit or TRzRichEdit

How to block the drag and drop in TRichEdit? delphi code I work with Rich edit and having difficulties on blocking the drag and drop feature specially dragging text from outside the form let say comming from IE to my RichEdit. ...

Difficulty with MFC template project in VS2010

I'm using Visual Studio 2010 to experiment with MFC. I have created a template MFC project by following the wizard. I chose a dialog based app, and unchecked other options like ActiveX controls. After making no code changes, I hit F5, and the app runs. Then, using the form designer, I drag a rich edit control from the toolbox onto th...

How to get text extent of RichEdit in Delphi

Does anyone know how to get the width and height of text in a TRichEdit control, in the same way that you would use TextWidth and TextHeight on a TCanvas? The reason I need to know this doing this is I have a RichEdit on a non-visible form that I copy the contents of to a canvas using Richedit.Perform(EM_FORMATRANGE, ...). The problem...

What is a "story" in the Text Object Model?

This documentation describes RichEdit and ITextDocument, which are part of MFC. RichEdit uses TOM, or text object model. The documentation makes repeated reference to "stories": The GetStoryCount property-get method retrieves the count of stories in this document. The GetStoryRanges property-get method retrieves the st...

RichEdit's ITextRange: Determine if a user's cursor is in a word?

I'm using ITextRange from a RichEdit control. I want to determine if a user's cursor is touching a word. The problem is that calling iTextRange.expand(tomWord) will include tailing spaces: Brackets indicate the range: Before: weas[]el . After: [weasel ]. My original plan was to expand the range, and check if it c...

how to make the richedit not to select or hightlight?

help i wnted the richedit cannot be highlighted/ disable the hightlight or selection of text? also remove the cursor pos. the application is intended for display only the rtf text and not editing so i dont need those features. in delphi ...

TRichEdit and URL highlighting problems

I am using the current code to highlight URLs on a TRichEdit: procedure TForm1.WndProc(var Message: TMessage); var p: TENLink; strURL: string; begin if (Message.Msg = WM_NOTIFY) then begin if (PNMHDR(Message.lParam).code = EN_LINK) then begin p := TENLink(Pointer(TWMNotify(Message).NMHdr)^); if (p.Msg = WM_LB...

Get richtext from a richedit in Delphi

Is there a way to get the RTF data from a richedit without using savetostream as in strStream := TStringStream.Create('') ; try RichEdit.Lines.SaveToStream(strStream); Text := strStream.DataString; strStream.CleanupInstance; finally strStream.Free ...

Keeping the caret at the end of text in a rich edit

I am writing an editor in Delphi (2009) using a TRichEdit component. The editor is append-only, in the sense that the caret must be at the end at all times, while maintaining the ability to copy using the mouse from elsewhere in the component. The way it is working at the moment is by moving the caret to the end whenever something is wr...

Bringing back the default context menu in RichEdit when using OLE callback

Dear StackOverflow, I have a RichEdit control that uses an implementation of the IRichEditOleCallback interface, so that it can host images and embedded objects. Part of this interface is the GetContextMenu method. If this method remains unimplemented, the context menu (obviously) will not show up. Returning E_NOTIMPL does not do the ...