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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Get Selected Text

Get Selected Text

Scheduled Pinned Locked Moved C#
help
2 Posts 2 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.
  • U Offline
    U Offline
    User 3450649
    wrote on last edited by
    #1

    Hi Friends I'm trying to get selected text from another program.like notepad,word and IE,I have an application which is running on system startup and it's show on the system tray. Now, whan I select some text from another program e.g. MS Word, IE, notepad, and then I hotkey my applicatin, I need to get selected text! If some know the idea behind it then please help Thanks to all

    S 1 Reply Last reply
    0
    • U User 3450649

      Hi Friends I'm trying to get selected text from another program.like notepad,word and IE,I have an application which is running on system startup and it's show on the system tray. Now, whan I select some text from another program e.g. MS Word, IE, notepad, and then I hotkey my applicatin, I need to get selected text! If some know the idea behind it then please help Thanks to all

      S Offline
      S Offline
      Skippums
      wrote on last edited by
      #2

      You need to do the following steps: 1. Get the handle to the target window. Use Spy++ to find out window names & classes to use with the Windows API. 2. Send a message to the window to get the selected text. That is all that is needed, but you will need to DllImport a number of windows API calls to do it. Let me know if you need more clarification. The documentation on the Win API method signitures can be found here[^].

      Sounds like somebody's got a case of the Mondays -Jeff

      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