Solved

RichEdit prohibit copy to clipboard

Posted on 2008-06-20
2
331 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 66
difference between String.subString() and String.subSequence() 6 258
matchUp  challenge 6 76
zeroMAx challenge 20 125
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 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