473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cutting From RichEdit

When I create my richedit control, I specify the font to be a system fixed
font. When I cut from this control and paste it into an outlook message, I
would prefer the pasted content to always be plain text instead of weird
spaced lines and small font. How can I control this?

--

Jul 22 '05 #1
3 2116

"news.tkdsoftware.com" <ch***@noreply.nospam.tkdsoftware.com> wrote in
message news:wc****************************@tkdsoftware.co m...
When I create my richedit control, I specify the font to be a system fixed
font. When I cut from this control and paste it into an outlook message,
I
would prefer the pasted content to always be plain text instead of weird
spaced lines and small font. How can I control this?


You've posted here often enough. You should know that it is the C++ language
that we discuss here not Windows programming. The best group for Windows
programming is news:comp.os.ms-windows.programmer.win32. I'm sure they can
answer your question.

john
Jul 22 '05 #2
I decided to intercept the message for VK_CONTROL+C and performed a manual
clipboard copy message of plain-text. Here's an excert from my code:

#define VK_C 67

BOOL COutputRichEditCtrl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN) {
if(GetKeyState(VK_CONTROL) && pMsg->wParam == VK_C) {
PutSelInClipboard();
return TRUE;
}
}
return CRichEditCtrl::PreTranslateMessage(pMsg);
}
void COutputRichEditCtrl::PutSelInClipboard()
{
CString strText = GetSelText();
int nLen = strText.GetLength();
if(OpenClipboard()) {
EmptyClipboard();
HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,nLen+4);
char *ptr = (char*)GlobalLock(hText);
strcpy(ptr, strText);
GlobalUnlock(hText);
::SetClipboardData(CF_TEXT,hText);
CloseClipboard();
GlobalFree(hText);
}
}

Hope this helps others and if there is a better way, feel free to post it.
Thanks,
Chris

--
"news.tkdsoftware.com" <ch***@noreply.nospam.tkdsoftware.com> wrote in
message news:wc****************************@tkdsoftware.co m...
When I create my richedit control, I specify the font to be a system fixed
font. When I cut from this control and paste it into an outlook message, I would prefer the pasted content to always be plain text instead of weird
spaced lines and small font. How can I control this?

--

Jul 22 '05 #3
news.tkdsoftware.com wrote:
I decided to intercept the message for VK_CONTROL+C and performed a
manual clipboard copy message of plain-text. Here's an excert from my
code:

Nobody cares here, this isn't a Windows newsgroup.

--
WW aka Attila
:::
"If you want to make an apple pie from scratch, you must first create the
universe." - Carl Sagan
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Liberal | last post by:
I am looking for the simplest forum, bbs script which has those features? new messages will be displayed only after the administrator reviewed allow users post without signing up display the...
5
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
1
by: Peter Taylor | last post by:
I am developing a word processor using MS Vis C++ 6 with MFC. I need to get the text of the current line of where the cursor is. I am using richedit (not a control). Does the EM_GETLINE work...
3
by: ozbear | last post by:
The title says it all. Since a Richedit control doesn't understand a backspace character ('\b', or 0x08) when I receive one I need to programmatically delete the last character from the Richedit...
1
by: P | last post by:
Hi. I am writting application and I need html richedit. When I will use: control_name.text="<img sroc=\"1.jpg\">" I wanna have image in richedit. But I dont know where can I find that...
0
by: PowerPlane | last post by:
Hi, all Happy valentine I am struggling to insert an animated-gif into a CRichEditCtrl. Before I post this question here, I did some googling. And I found an article to introduce how to insert a...
1
by: Patty O'Dors | last post by:
Hi I'm trying to create an application with a RichEdit control, I found that CreateWindow always returns a null hWnd unless I call LoadLibrary("riched20.dll") first (the error code from...
0
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.