cricheditctrl

CRichEditCtrl::GetSelText() is not working right

MFC File: winctrl4.cpp (C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc) CString CRichEditCtrl::GetSelText() const { ASSERT(::IsWindow(m_hWnd)); CHARRANGE cr; cr.cpMin = cr.cpMax = 0; ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr); CStringA strText; LPSTR lpsz=strText.GetBufferSetLength((cr.cpMa...

Detecting Drag/Drop Operations on CRichEditCtrl

I've had loads of problems detecting copy/paste operations in my custom subclass of CRichEditCtrl (WM_PASTE,etc don't get received) but got a working solution which traps paste events and removes formatting on pasted text. Now I realised that CRichEditCtrl supports drag & drop by default and this bypasses my custom code. Are there easy ...

How to disable dragging from a Rich Edit Control

I use a subclass of CRichEditCtrl to provide a CEdit+ type control. One thing I want is to disable drag-drop functionality, which the base class provided by default. Disabling dropping is easy: ::RevokeDragDrop(m_hWnd); But I can't see a simple way to disable the control being a drag-source. Is there an easy way? ...

How to stop a MFC/win32 control re-painting

I have a CRichEditCtrl, and an algorithm works on its contents in-place, iterating through the contents and making changes. This seems to cause it to re-paaint every time, which causes flickering and a noticeable time to complete the operation, especially if the control starts scrolling. I wondered if there's a neat way for me to stop it...

[MFC] Emulating 'delete' key-press from context menu

I added a context menu to a MFC CRichEditCtrl, it includes a delete option which does: ReplaceSel("",TRUE); It appears to work but when I look at the undo log, it's not the same... we end up with characters being lost at the end of the sequence. Any ideas how I can make my code be the same as what happens when you press DELETE? Or even...