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#
  4. How to paste outside of my application

How to paste outside of my application

Scheduled Pinned Locked Moved C#
tutorialquestion
10 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.
  • M Offline
    M Offline
    Mahmoud EL Shazly
    wrote on last edited by
    #1

    Hello, How can I paste outside my application via mouse clicks, When I click in any textbox outside my application it paste from the clipboard ? I'm already have a code to detect the mouse events but I don't know how to paste outside my windows application so please provide a good explain and a small example. Regards :)

    JusT LeT YouR MinD WorK

    B B OriginalGriffO 3 Replies Last reply
    0
    • M Mahmoud EL Shazly

      Hello, How can I paste outside my application via mouse clicks, When I click in any textbox outside my application it paste from the clipboard ? I'm already have a code to detect the mouse events but I don't know how to paste outside my windows application so please provide a good explain and a small example. Regards :)

      JusT LeT YouR MinD WorK

      B Offline
      B Offline
      BillWoodruff
      wrote on last edited by
      #2

      "When I click in any textbox outside my application it paste from the clipboard ?" This doesn't quite make sense: other applications running, that you haven't created, may, or may not, have text-entry fields that allow pasting. If they do, you can just use keyboard Control-V to paste, once you've clicked inside the other application to set the insertion cursor in a Control that allows pasting. Why do you need "more" than that ? Yes, you can use API calls to find out what window the mouse clicked on "outside your application," but then: how do you discover what kind of control in this other application (you have no control over) they clicked on ? How do you know they clicked on a control that allowed pasting in of text ? So, could you clarify exactly what you mean by "textBox outside my application," and why would you want to use some mouse-click combination to paste. yours, Bill

      ~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal

      M 2 Replies Last reply
      0
      • M Mahmoud EL Shazly

        Hello, How can I paste outside my application via mouse clicks, When I click in any textbox outside my application it paste from the clipboard ? I'm already have a code to detect the mouse events but I don't know how to paste outside my windows application so please provide a good explain and a small example. Regards :)

        JusT LeT YouR MinD WorK

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        Not so easy. You need a global mouse hook to discover the mouse anywhere. When a click happens, you have to find out the type of the control clicked. In case of "common" textboxes, you can then send the keys for inserting from the clipboard. It may fail with Java applications when they use "swing".

        1 Reply Last reply
        0
        • M Mahmoud EL Shazly

          Hello, How can I paste outside my application via mouse clicks, When I click in any textbox outside my application it paste from the clipboard ? I'm already have a code to detect the mouse events but I don't know how to paste outside my windows application so please provide a good explain and a small example. Regards :)

          JusT LeT YouR MinD WorK

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Don't post the same question in multiple places - it duplicates work and can annoy people. You have already posted this in QA, so work with the version there.

          This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          M 1 Reply Last reply
          0
          • B BillWoodruff

            "When I click in any textbox outside my application it paste from the clipboard ?" This doesn't quite make sense: other applications running, that you haven't created, may, or may not, have text-entry fields that allow pasting. If they do, you can just use keyboard Control-V to paste, once you've clicked inside the other application to set the insertion cursor in a Control that allows pasting. Why do you need "more" than that ? Yes, you can use API calls to find out what window the mouse clicked on "outside your application," but then: how do you discover what kind of control in this other application (you have no control over) they clicked on ? How do you know they clicked on a control that allowed pasting in of text ? So, could you clarify exactly what you mean by "textBox outside my application," and why would you want to use some mouse-click combination to paste. yours, Bill

            ~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal

            M Offline
            M Offline
            Mahmoud EL Shazly
            wrote on last edited by
            #5

            well I will explain what I want to do. I have a windows application which is ready to receive some data from the user then make some operations on it then get out the results. Then the user have to copy the data from the application to store it on webpage to save it on the server. So what I want to do is to send the results from the the application to the webpage programmatically but I think its not easy, So I think it will be helpful if I made the user paste by doing a double click which I will copy the data from the windows app to clipboard and change it when the user paste on the webpage. so any other good suggestion for this ?

            JusT LeT YouR MinD WorK

            B 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Don't post the same question in multiple places - it duplicates work and can annoy people. You have already posted this in QA, so work with the version there.

              This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.

              M Offline
              M Offline
              Mahmoud EL Shazly
              wrote on last edited by
              #6

              I didn't mean to duplicate my post in many places and if it done I'm sure it done by fault... sorry

              JusT LeT YouR MinD WorK

              1 Reply Last reply
              0
              • M Mahmoud EL Shazly

                well I will explain what I want to do. I have a windows application which is ready to receive some data from the user then make some operations on it then get out the results. Then the user have to copy the data from the application to store it on webpage to save it on the server. So what I want to do is to send the results from the the application to the webpage programmatically but I think its not easy, So I think it will be helpful if I made the user paste by doing a double click which I will copy the data from the windows app to clipboard and change it when the user paste on the webpage. so any other good suggestion for this ?

                JusT LeT YouR MinD WorK

                B Offline
                B Offline
                Bernhard Hiller
                wrote on last edited by
                #7

                Mahmoud EL-Shazly wrote:

                copy the data from the application to store it on webpage to save it on the server

                That means: there is a web page with a "FORM" element, and on "SUBMIT" the data are transfered to the web server with a GET or - more likely - POST request to a specific URL. Why don't you just do some reverse engineering, and have your application send the data directly to that URL? .Net components for that purpose are available.

                M 1 Reply Last reply
                0
                • B Bernhard Hiller

                  Mahmoud EL-Shazly wrote:

                  copy the data from the application to store it on webpage to save it on the server

                  That means: there is a web page with a "FORM" element, and on "SUBMIT" the data are transfered to the web server with a GET or - more likely - POST request to a specific URL. Why don't you just do some reverse engineering, and have your application send the data directly to that URL? .Net components for that purpose are available.

                  M Offline
                  M Offline
                  Mahmoud EL Shazly
                  wrote on last edited by
                  #8

                  I'm not the developer of that web application I can just use it, so I cannot edit it All what I need to send the paste action from my application to the windows by double click in any textbox out of my application as I said I already have a code to detect the mouse events anywhere but I don't know how to send the command to the windows to do the paste action... Will the API help ?

                  JusT LeT YouR MinD WorK

                  D 1 Reply Last reply
                  0
                  • M Mahmoud EL Shazly

                    I'm not the developer of that web application I can just use it, so I cannot edit it All what I need to send the paste action from my application to the windows by double click in any textbox out of my application as I said I already have a code to detect the mouse events anywhere but I don't know how to send the command to the windows to do the paste action... Will the API help ?

                    JusT LeT YouR MinD WorK

                    D Offline
                    D Offline
                    DaveyM69
                    wrote on last edited by
                    #9

                    In your situation you don't need to paste at all! Examine the html source of the webpage that you have been trying to paste into. You need to replicate that functionality in your code and send the data (either post or get) directly to the web server programmatically from your application. All the information you need about the expected data to make this work is already in the html source.

                    Dave
                    Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
                    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

                    1 Reply Last reply
                    0
                    • B BillWoodruff

                      "When I click in any textbox outside my application it paste from the clipboard ?" This doesn't quite make sense: other applications running, that you haven't created, may, or may not, have text-entry fields that allow pasting. If they do, you can just use keyboard Control-V to paste, once you've clicked inside the other application to set the insertion cursor in a Control that allows pasting. Why do you need "more" than that ? Yes, you can use API calls to find out what window the mouse clicked on "outside your application," but then: how do you discover what kind of control in this other application (you have no control over) they clicked on ? How do you know they clicked on a control that allowed pasting in of text ? So, could you clarify exactly what you mean by "textBox outside my application," and why would you want to use some mouse-click combination to paste. yours, Bill

                      ~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal

                      M Offline
                      M Offline
                      Mahmoud EL Shazly
                      wrote on last edited by
                      #10

                      I can detect the mouse clicks in/outside my application I just want to send WM_PASTE using API to windows so it will execute the paste command. ---------------------------- I need to do that because the user needs to take some data from the customer then enter it to a webpage more than one time and this takes a long time so I want to the user able to store the data in my application then paste them into the webpage faster, this will save a lot of time and of course a lot of money. I can handle it if the user used it with a control that don't allow pasting in on it. Now all what I need is to send the paste command to windows successfully.

                      JusT LeT YouR MinD WorK

                      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