Windowless RichEdit & ITextServices

in microsoft's sample of windowless richedit, they do something like this:1. Implement ITextHost interface methods2. Provide WindowProc like funx that handle the windowless richedit message. It handles all the message passed to window and handle it first in the ITextServices internal message proc (v ...

Callback Function, Windowless RichEdit

yep! that's right! i'm gonna ask u some question as usual :)1. What r Callack functions for? & whats make it different from 'general' functions?2. how to call callback function?3. sample scratch callback program :) ?4. Difference between linefeed and carriage return? i'm confused. in richedit co ...

Anyone using the windowless RichEdit ?

It's a bit strange... I've noticed that no-one seems to use the windowless RichEdit. I'm using it myself to get a bit more advanced control over the behaviour. But on the net I couldn't find any links, help or even just people asking questions about the windowless one.Is it being shunned away from, ...

Copy html content into richedit as text

I copied some selection on the html web pages into the clipboard, and want to paste them into a richedit control in the text format, that means no more html tags in the richedit, how should I do ? ...

Richedit , colored text, problem if more than 255 chars

I am trying to highlight certain text in a richedit box using CHARFORMAT in VC6++. The program seems to work ok if the box contains less than 255 characters. If there are more than 255 chars, all the text color becomes black in the box. I am not sure what is going wrong here. Any insight into this m ...

RichEdit and text color

I'm using CFormView with multiple RichEdit controls in it. Some of these controls need different text colors. I'm using this in 'OnInitialUpdate()':// Set attributesCHARFORMAT cf;cf.cbSize = sizeof(CHARFORMAT);cf.dwMask = CFM_COLOR | CFM_FACE | CFM_SIZE | CFM_BOLD;cf.dwEffects = CFE_BOLD;cf.yHeight ...

RichEdit: Selected text loses color formatting after EM_GETSELTEXT

In my Win32 API-coded app, I have subclassed the WNDPROC of a Richedit (v.2) window, capturing WM_LBUTTONUP. Whenever I select colored text (CHARFORMAT v.1) in the Richedit window, and send EM_GETSELTEXT to retrive it (which is does, successfully), the selected text loses reverts to white. Does anyo ...

Hooking WindowLess RichEdit in MSN 6.1

Can I write message in RichEdit?Canv't fo it with TxSetText(have not problems with TxGetText ) ...

richedit + copy text

I want to copy from a richedit with the next code:CString strBuffer;int nLineLength, nLineCount;nLineCount = m_richFile.GetLineCount();//set app nameif(nLineCount > 0){nLineLength = m_richFile.LineLength(0);m_richFile.GetLine(0, strBuffer.GetBuffer(nLineLength));m_editAppName.SetWindowText(strBuf ...

why i cannot access text content of RICHEDIT?

i am trying to examine the text content of a RICHEDIT. the text are inputs.i used a WindowFinder like program to locate the RICHEDIT and havied tried several ways to get the input text...but it seems none of them works....can anyone help? ...

Abt RichEdit and ATL containment

i need some help here about Richedit and ATL stuff about COM containment.1. What events are occured when i clicked an OLE object inserted into RichEditView?i need to know who's handling the drawing of RectTracker on the OLE object when it is single clicked. coz it doesnt show any recttracker when it ...

Richedit page break, please help

I have a form with richedit field, text in inserted from a access database (this works perfect).I also use quickreport to show print preview and print or save it to pdf (or something else).Sometimes the text inserted into the richedit field is too large to fit into 1 page.How can I make it that rich ...

Why a picture inserted into richedit can't display?

I am now puzzled by a random failure of inserting a picture into a windowless richedit. In general, the picture in the richedit can display normally. When the failure occurs, where the picture inserts is a blank white box, when double click it, the picutre can be opened by a image explorer. The pict ...

Multi-language Text Editor

I'd like to develop a richedit-like text editor using DC by VC++.It must support all the languages around the world.I presume that there will be a little easier way than implementing all the details according to each language considering every case.Can someone lead me to a way to do it? ...

Keeping the scroll in a RichEdit Control...

I've created an application that uses a RichEdit control to display a real time status (it is the easiest way to have nice text formating with colors). Anyway, this works pretty well.I update it automatically every seconds.The contents of the control is something like that:POWER: OKTIME: OKPERIOD: O ...

Richedit CDC???

I have a RichEdit control and want to find the character height (not cell height) in it's selection. For this, I get the control's CDC and then use the GetTextMetrics function. My problem is the textmetrics structure it's filled with the same members even if I change richedit's text height (for exam ...

Try capturing client text crashed?

I wrote a client window program with richedit for text handling. It work fine.int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow){....hwnd = CreateWindowEx(0, //WS_EX_CLIENTEDGE,"REClient", //WindowClass"RichEdit Client", //CaptionWS_OVE ...

inside WM_NCHITTEST

Are there any connection beetween the WM_NCHITTEST and Mouse Messages such as WM_MOUSEMOVE, WM_LBUTTONDBLCLKS, etc?coz i got problems in my prog. My window (with client edge style) never receive the mouse message if i handle the WM_NCHITTEST in the TxSendMessage method of ITextServices, instead of p ...

RichEditView Glitching - Terminal Emu

I have a problem in which my program (a terminal emulator of sorts) has to read in the text from a richedit, add text to it, remove text, etc. All this is done on the fly from code (not from a user selecting text, fromatting, etc. Once you call SetWindowText() all formatting (bold, color, etc) is lo ...

HTML Hooking

I am working on an MFC aplication which would display a HTML page using CHTMLView class. The HTML page contains a richedit like text box and I need to get the text in the text box. How can I do this. There is some article saying that I should rewrite the OnBeforeNavigate function, But I'm not sure h ...

GetWindowText problem

I have the same problem as this, but i havent get the answer . so iam forwarding u the same . please give me the answer as soon as possible, please .Example of my code:FILE*fp2;char tmp[10];GetDlgItem(IDC_EDIT_DFILENAME)->GetWindowText(tmp,9);the prob is i couldnot type more than 1 character in t ...

RichEdit - NOT select text by default

We are using VC++ v6 and have a control on a form that is a RichEdit. When there is data in the control, and you tab into it, it of course selects and hilights all the text. Is there a way to NOT do that and put the cursor in the first position? ...

Paste text into richedit without formatting

I'm using the RichEdit control in my program and I'm wondering if there's any way to make sure that when someone Pastes text into it from the clipboard so that the formatting of that text is removed.PS. I understand that I can probably write my own routine instead of using m_pRichEdit.Paste(); but w ...

richedit text alignment

I want to align my richedit text alignment from LTR to RTL. how can do that ?!? ...

How Could I Copy the Content of RichEdit Consisting of Text and Pictures to MS Word?

Now i am stuck in copying the content of richedit to MS Word.In my application, there is a window-less richedit control with the ITextService. In the richedit, i can input text and pictures.When Ctrl+C are pressed down, the content of richedit is copied to clipboard. I want to paste the content in M ...

Change text color of RichEdit Control

How can i change text color of RichEdit Control 2 from given COLORREF. ...

Loading text file into RichEdit control

I am using Visual C++ 6.0, and I created a RichEdit control. When the program is loaded, I want to display text from a file in it. I am unsure of how to do this. Can someone help? ...

Richedit box, colored text, scroll problem

I am a newbie so please be kind:I am trying to develop a dialoge based program that has 3 richedit boxes. The objective of the program is to compare the text in the first 2 boxes. If the text is same, copy text from box 1 to box 3, else, copy and make the text red in all the three boxes at that posi ...

Howto *completely* remove text from RichEdit

I have a RichEdit in my GUI. I use it for user to write some text into it & when the user Hits enter key, I read all the text from the RichEdit and the also *removes* the text from it. The way i remove the text from the richedit is I set the "" as the new text into the RichEdit. The pr ...

How to empty/remove text from RichEdit

I have a RichEdit in my application. At certain point i want to remove all the Text from RichEdit. The way i do it now is i set "" as the new text. Is there is a better way then this????Secondly I want to set the cursor to the beginning of the RichEdit. Please tell me how can i place the c ...

Drop text on richedit Winapi

I have a richedit control and when dropping text from another control I would like to change the format of that text.I wonder which messages I should trap or how to do this in plain Winapi. (I have already subclassed the pasting message) ...

Richedit Text ordering

I've got a dialog window with a Richedit box that loads a text file. But every time any key is pressed it will output that character (including returns, backspaces, etc) and then return to the very beginning of the text box. This causes the text to write backwards and lots of frustration. Any ideas ...

adding text to RichEdit box !

I used to below function to add string to RichEdit box, it works fine on Win98 or WinXP ... but it has bug in Win2000 !Function:void CResultDialog::AddText(CString str, COLORREF rgb, BOOL bold, BOOL italic, BOOL underline){// get current length from rich text box ...int nCurLen = m_Rich.GetTextLengt ...

Searching for text in richedit view or control

I created a richedit view and wrote "hello world" inside it.I want to search for the text "hello" in the view.For some reason, nothing I do works.I tried findtext of the view and also of the control that goes with it.Here is the code:LPCTSTR Test = "hello";FINDTEXTEX ft ...

RichEdit Text

I have some text in a RichEdit Box and want to be able to print just the text to a printer. Here's the code I have now, but something is missing or wrong:CPrintDialog dlg(FALSE, PD_ALLPAGES | PD_COLLATE | PD_NOPAGENUMS | PD_HIDEPRINTTOFILE);// dlg.GetDefaults();if (dlg.DoModal()==IDOK){// is a defau ...

RichEdit 2 - Appending RICH Text

HelloI'm using the win32 api Richedit 2 control. No MFC.Are streams the only way to read RICH TEXT data into the control?I am able to use the following to append PLAIN text to the control:CHARRANGE rng;rng.cpMin = -1;rng.cpMax = -1;SendMessage(richedit,EM_EXSETSEL,0,(LPARAM) &rng);SendMessage(ri ...

Color text in RichEdit

How do I color text in RichEdit symbol. I tried the following but that doesn't work!Any ideas?COLORREF color = COLORREF(0,0,130);CHARFORMAT cf;GetSelectionCharFormat( cf );cf.cbSize = sizeof(cf);cf.dwMask = CFM_FACE|CFM_COLOR;cf.crTextColor = color; strcpy(cf.szFaceName, "Arial"); SetSel(0 ...

Appending text to RichEdit

I want to input a sentence in a richEdit control, I don't want to use setwindowtext, cause that deletes the contents before adding a new string.In a listbox you can use addstring for that, but what can I use for a richEdit or a Editbox(multiline)???So I want to be able to append text to a richeditgr ...

changing text color in richedit - works in debug, but doesn't work in release

if I use the following lines to change the color of text in a richedit:m_RichEdit.SetSelectionCharFormat(cfmtGREEN);m_RichEdit.SetSel(-1, -1);m_RichEdit.ReplaceSel("this is a line\n");Why does it work in debug builds but not in release builds? How to fix it? ...

Using RichEdit Control to display a text file

I've added a RichEdit Control in my dialog application and would like to use it to read and display a plain text file.I've difficulty understanding how to write the call back function when using the CRichEditCtrl::StreamIn method.Can anyone provide a sample ? Or perhaps there's other ways to read a ...

How to control the background color of selected text in a RichEdit Control

I read in the MSDN librairy that it's possible to control the background color of a selected text in RichEdit control. I use the structure CHARFORMAT2 and try to update the background color but it doesn't seems to work. CHARFORMAT2 *cf;cf = new (CHARFORMAT2);m_RichEdit1.GetSelectionCharFormat(*cf);c ...

using handles to get RichEdit text

I'm trying to get the text from two RichEdit controls which are located in external application, but I can't get the the text with GetWindowText. What is my mistake?Any help would be much appreciated... Thanks in advance.Here's the code:#include <iostream>#include <fstream>#include <W ...

RichEdit--how to get format data size + text length

I want to copy the content of a richedit control to a buffer.You know the text in the richedit have format.I want to copy both the text and its format.First I need to allocate the buffer,so I need to know the size of the formatted text.I know I can use the GetWindowText() to get the text length.But ...

RICHEDIT to load and save rtf text

Problem descriptionI am interested in loading rtf files in my RICHEDIT control, and am also interested in saving current formated text as rtf file.Question1. What is window message to obtain rtf formated text string from a RICHEDIT control ?2. How to assign rtf format text stringto RICHEDIT ?waiting ...

Format text in richedit without moving cursor and selection

Question:How to format a character or word in a richedit controlwithout moving cursor and without making selection.I am basically willing to write a syntax highlighter for C++,but unfortunately if I * make selection on a keyword or a character* then hide selection* then format it* then take cursor b ...

Changing text limit in a Unicode RichEdit control when sending EM_REPLACESEL

I'm having a strange problem that only occurs in the Unicode build of my program, and not in the ANSI build. When adding text in the Unicode RichEdit control via EM_REPLACESEL, it stops being able to add text after it hits a 0x7FFF character limit. The only difference I can see between the two build ...

Format text in richedit without using EM_SETSEL

As in other help topics it is stated that if we need to format a specific text then we must select it first and then format it, asSendMessage(richctrl, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); where richctrl is handle (HWND) of richedit controlcf is CHARFORMATBUT, I want to know if we can ...

Get start/end Positions of currently visible text in richedit

I have managed to write a lighweight c/c++ syntax highlighter through my previous topic and I was 90% successful except 3 thingsI want1. To get exact position of cursor before highlighting the syntax, and after highlighting the syntax I want to put the cursor back on previous position.Seconldy, impo ...

Scroll text in Richedit Control

I'm using a richedit control to output some text and links. I'm using C and WinAPI commands. I know, this is a C++ Forum, but maybe I can get some help anyway.I've coded a function, that writes the content of a buffer to the richedit control by using the command EM_REPLACESEL. Everything works fine. ...

How to modify a RichEdit control's text without changing the selection and scrollbars

I'm trying to change the text in a RichEdit control (sometimes the whole text !!) while keeping the caret, the display (and the scrollbars) at the same position on screen…I’ve tried almost anything, but with no success…Everytime you modify the text, the control always automatically scrolls …How ...