Solved

RichEdit prohibit copy to clipboard

Posted on 2008-06-20
2
339 Views
Last Modified: 2013-11-20
I have become convinced to use CRichEdit for displaying and printing our reports.  My problem is that some of the reports contain financial/auditing data.  I'm concerned that a user could ^C an entire financial report, paste it to WordPad, and then alter the data.  It would NEVER work long term, but, even in the short term, it could be a real problem.

Is there a way to keep the user from performing a copy operation on a RichEdit control?

Thanks, rick
0
Comment
Question by:rickatseasoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 21834787
you have to derive your own control class, and override the PreTranslateMessage function:


BOOL CMyRichEdit::PreTranslateMessage(MSG* pMsg) 
{
 	// disable copy by mouse or keyboard
	switch( pMsg->message )
	{
	case WM_KEYDOWN:
		if ( pMsg->wParam==67 && GetKeyState(VK_CONTROL) )
			return true;
		break;
	case WM_RBUTTONDOWN:
		return true;
	}
	
	return CMyRichEdit::PreTranslateMessage(pMsg);
}

Open in new window

0
 

Author Closing Comment

by:rickatseasoft
ID: 31469122
PERFECT!

Thanks, Rick
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question