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. I want to know how to copy the highlighted text?

I want to know how to copy the highlighted text?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 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.
  • P Offline
    P Offline
    Pony
    wrote on last edited by
    #1

    Hello, I want to know how to copy the highlighted text to the clipboard (like pressing Ctrl+C) in my application using a button. What do I have to do after I map button control? The problem is the highlighted text is not only in my application but it's in the other application. (ex. browser, notepad, etc.) Help me, please. I have to finish my application within 4 days. Please...:((

    M J 2 Replies Last reply
    0
    • P Pony

      Hello, I want to know how to copy the highlighted text to the clipboard (like pressing Ctrl+C) in my application using a button. What do I have to do after I map button control? The problem is the highlighted text is not only in my application but it's in the other application. (ex. browser, notepad, etc.) Help me, please. I have to finish my application within 4 days. Please...:((

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      I don't understand your problem completly,but maybe if you use RichEditView it helps you. Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
      Wish You Were Here-Pink Floyd-1975

      1 Reply Last reply
      0
      • P Pony

        Hello, I want to know how to copy the highlighted text to the clipboard (like pressing Ctrl+C) in my application using a button. What do I have to do after I map button control? The problem is the highlighted text is not only in my application but it's in the other application. (ex. browser, notepad, etc.) Help me, please. I have to finish my application within 4 days. Please...:((

        J Offline
        J Offline
        Jon Hulatt
        wrote on last edited by
        #3

        Assuming you have a window handle, you can send the other window a WM_COPY message. Then, in theory, whatever was selected is in the clipboard and you can have a go at it. The other way to do it, in theory at least, would be to subclass the other app's window, and then use typical CWnd/CEdit functions to get the text (GetSel(), GetWindowText(), that kind of thing). Sorry to dissapoint you all with my lack of a witty or poignant signature.

        P 1 Reply Last reply
        0
        • J Jon Hulatt

          Assuming you have a window handle, you can send the other window a WM_COPY message. Then, in theory, whatever was selected is in the clipboard and you can have a go at it. The other way to do it, in theory at least, would be to subclass the other app's window, and then use typical CWnd/CEdit functions to get the text (GetSel(), GetWindowText(), that kind of thing). Sorry to dissapoint you all with my lack of a witty or poignant signature.

          P Offline
          P Offline
          Pony
          wrote on last edited by
          #4

          Thank you very much. I've already send WM_COPY message but it doesn't work. There's nothing in the clipboard. ::SendMessage(m_hWnd, WM_COPY, 0, 0); I don't know why it doesn't work. Did I forget something? Guide me, please. :confused:

          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