Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to disable copy/paste in CEdit?

How to disable copy/paste in CEdit?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Donguy1976
    wrote on last edited by
    #1

    Hi there, Is there a way to disallow users from pasting anything to CEdit box control? Right now they can right click and select the PASTE menu option. And also do a Control + V. How to disable this? please give some sample code. Thanks in advance.

    L E 2 Replies Last reply
    0
    • D Donguy1976

      Hi there, Is there a way to disallow users from pasting anything to CEdit box control? Right now they can right click and select the PASTE menu option. And also do a Control + V. How to disable this? please give some sample code. Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Donguy1976 wrote:

      Is there a way to disallow

      Yes there is. See Subclassing CEdit to disable clipboard operations[^] and see if that helps you.

      E 1 Reply Last reply
      0
      • L Lost User

        Donguy1976 wrote:

        Is there a way to disallow

        Yes there is. See Subclassing CEdit to disable clipboard operations[^] and see if that helps you.

        E Offline
        E Offline
        Erudite_Eric
        wrote on last edited by
        #3

        Oh, but he said "Please give me some code". Are you sure he can handle a link? It might involve thinking....

        L 1 Reply Last reply
        0
        • D Donguy1976

          Hi there, Is there a way to disallow users from pasting anything to CEdit box control? Right now they can right click and select the PASTE menu option. And also do a Control + V. How to disable this? please give some sample code. Thanks in advance.

          E Offline
          E Offline
          Erudite_Eric
          wrote on last edited by
          #4

          Here you go:

          if (add\_uevent\_var(env,
          	   "MODALIAS=usb:"
          	   "v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X",
          	   le16\_to\_cpu(copy\_dev->descriptor.idVendor),
          	   le16\_to\_cpu(copy\_dev->descriptor.idProduct),
          	   le16\_to\_cpu(copy\_dev->descriptor.bcdDevice),
          	   copy\_dev->descriptor.bDeviceClass,
          	   copy\_dev->descriptor.bDeviceSubClass,
          	   copy\_dev->descriptor.bDeviceProtocol,
          	   alt->desc.bInterfaceClass,
          	   alt->desc.bInterfaceSubClass,
          	   alt->desc.bInterfaceProtocol))
          	return -ENOMEM;
          
          1 Reply Last reply
          0
          • E Erudite_Eric

            Oh, but he said "Please give me some code". Are you sure he can handle a link? It might involve thinking....

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Erudite_Eric wrote:

            might involve thinking

            If 99% of the people asking questions here actually put forth any effort in thinking, then 99% of the questions would disappear.... :-)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups