Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,420 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,987 people online right now. Registration is fast and FREE... Join Now!




Ban Ctrl+V

 
Reply to this topicStart new topic

Ban Ctrl+V

RomTibi
19 Jan, 2008 - 03:22 AM
Post #1

New D.I.C Head
*

Joined: 19 Jan, 2008
Posts: 2

How can I ban the use of Ctrl+V key combination to avoid the use of RASTE in EditBoxes? In VC6++, please
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Ban Ctrl+V
19 Jan, 2008 - 12:10 PM
Post #2

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,463



Thanked: 10 times
Dream Kudos: 325
My Contributions
Why would you want to do that?
User is offlineProfile CardPM
+Quote Post

RomTibi
RE: Ban Ctrl+V
20 Jan, 2008 - 12:42 AM
Post #3

New D.I.C Head
*

Joined: 19 Jan, 2008
Posts: 2

The reason could be: to prevent saving sensitive data (passwords, etc.) locally, into a file, for easy copy-paste into the application. It's easier to steal secrets with the computer.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Ban Ctrl+V
20 Jan, 2008 - 12:49 AM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,550



Thanked: 67 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(RomTibi @ 20 Jan, 2008 - 01:42 AM) *

The reason could be: to prevent saving sensitive data (passwords, etc.) locally, into a file, for easy copy-paste into the application. It's easier to steal secrets with the computer.

Make a windows registry hook & search the keystrokes for that key combination. If it matches, don't return that value to the process.
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Ban Ctrl+V
20 Jan, 2008 - 07:42 AM
Post #5

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
You don't need to do anything of that sort when you can use a simple technique.

Use the TextChanged() or Changed() (I'm not sure which one) Event and compare the length of the newly entered text with that of the previous value.

If the length has increased or decreased by 1, it means that the user has either entered a character or pressed backspace.

If the length has decreased by more than 1, it means that the user has selected a couple of characters and pressed delete.

If the length has increased by more than 1, it's a copy-paste operation. If this case is true, ignore the new text and if required, change the contents of the textbox back to its original value.
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Ban Ctrl+V
20 Jan, 2008 - 08:51 PM
Post #6

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,463



Thanked: 10 times
Dream Kudos: 325
My Contributions
If the information is on the computer, then the user can get at it. I'm not one to squash people's ideas on here, but I think the chance of someone "copying and pasting" sensitive information is trivial. If they can't be trusted to not duplicate the information, then they shouldn't be trusted with it in the first place.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:25AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month