Solved

RichEdit prohibit copy to clipboard

Posted on 2008-06-20
2
319 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
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now