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. Copy, Cut and Paste

Copy, Cut and Paste

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 5 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.
  • C Offline
    C Offline
    CDRAIN
    wrote on last edited by
    #1

    I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App, I see on web that I need to use functions: BOOL SetClipboardText(LPCTSTR pszText) int GetClipboardText(LPTSTR pszBuf, int nLength) but I can I get the selected text of a textbox or a selected object? Thanks

    R H D R 4 Replies Last reply
    0
    • C CDRAIN

      I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App, I see on web that I need to use functions: BOOL SetClipboardText(LPCTSTR pszText) int GetClipboardText(LPTSTR pszBuf, int nLength) but I can I get the selected text of a textbox or a selected object? Thanks

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      See How to Implement Drag and Drop Between Your Program and Explorer[^] but I dont think you need to this article see ClipSpy[^] and http://www.codeproject.com/clipboard/archerclipboard1.asp[^] does helpful?


      WhiteSky


      1 Reply Last reply
      0
      • C CDRAIN

        I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App, I see on web that I need to use functions: BOOL SetClipboardText(LPCTSTR pszText) int GetClipboardText(LPTSTR pszBuf, int nLength) but I can I get the selected text of a textbox or a selected object? Thanks

        R Offline
        R Offline
        rrrado
        wrote on last edited by
        #3

        If you are using MFC, use CEdit::Copy(), CEdit::Paste(). But I'm still wondering where have you found SetClipboardText(). There is no such windows API


        rrrado

        1 Reply Last reply
        0
        • C CDRAIN

          I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App, I see on web that I need to use functions: BOOL SetClipboardText(LPCTSTR pszText) int GetClipboardText(LPTSTR pszBuf, int nLength) but I can I get the selected text of a textbox or a selected object? Thanks

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          CDRAIN wrote:

          I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App

          For edit controls, this is "on" by default.

          CDRAIN wrote:

          ...can I get the selected text of a textbox or a selected object?

          Are you looking for GetWindowText()?


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • C CDRAIN

            I need to implement Copy,Cut & Paste to and from Windows Clipboard functionality on my C++ App, I see on web that I need to use functions: BOOL SetClipboardText(LPCTSTR pszText) int GetClipboardText(LPTSTR pszBuf, int nLength) but I can I get the selected text of a textbox or a selected object? Thanks

            R Offline
            R Offline
            RickyC
            wrote on last edited by
            #5

            Hi CDRAIN, try GetClipboardData and SetClipboardData functions. Maybe this is what you're looking for. cheers!

            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