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. Visual Basic
  4. Selected Text

Selected Text

Scheduled Pinned Locked Moved Visual Basic
jsonquestion
7 Posts 5 Posters 1 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.
  • T Offline
    T Offline
    Taylor
    wrote on last edited by
    #1

    I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

    A.E.K

    L D D 3 Replies Last reply
    0
    • T Taylor

      I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

      A.E.K

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      AFAIK that is impossible to know. There may be several items selected in several controls all over the place, and Windows does not know that. Selection is a matter internal to the Control or other object that supports it. You can interrogate the clipboard. You could start sending CTRL/C to different controls, and watch the clipboard. But a Control does not have to obey CTRL/C... :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


      1 Reply Last reply
      0
      • T Taylor

        I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

        A.E.K

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        There's no way to tell and no API to call to tell you. There are simply too many different controls out there handling text is so many different ways. It's entirely up to the control containing the text in question. There's no standard method anyn control uses to expose this information.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        1 Reply Last reply
        0
        • T Taylor

          I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

          A.E.K

          D Offline
          D Offline
          DigiOz Multimedia
          wrote on last edited by
          #4

          A.E.K wrote:

          I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

          Is the other application (2nd one) where the text is selected also a custom application? If it is you could use a standard Windows OS Message to notify your 1st application when text is selected.

          Pete Soheil DigiOz Multimedia http://www.digioz.com

          Z 1 Reply Last reply
          0
          • D DigiOz Multimedia

            A.E.K wrote:

            I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?

            Is the other application (2nd one) where the text is selected also a custom application? If it is you could use a standard Windows OS Message to notify your 1st application when text is selected.

            Pete Soheil DigiOz Multimedia http://www.digioz.com

            Z Offline
            Z Offline
            Zia Ul Haq Soofi
            wrote on last edited by
            #5

            i agreed with him and want to add some more clarification in these comments that if other application is custome application and you have the source available then you can raise an event for the selection you have made. Hope you got the idea.

            Be a part of solution, rather then be a part of problem

            T 1 Reply Last reply
            0
            • Z Zia Ul Haq Soofi

              i agreed with him and want to add some more clarification in these comments that if other application is custome application and you have the source available then you can raise an event for the selection you have made. Hope you got the idea.

              Be a part of solution, rather then be a part of problem

              T Offline
              T Offline
              Taylor
              wrote on last edited by
              #6

              Nope. it should work every where. thanks everybody.

              A.E.K

              D 1 Reply Last reply
              0
              • T Taylor

                Nope. it should work every where. thanks everybody.

                A.E.K

                D Offline
                D Offline
                DigiOz Multimedia
                wrote on last edited by
                #7

                A.E.K wrote:

                Nope. it should work every where. thanks everybody.

                That can not be easily done, and you shouldn't need to do something like that either for a typical application. Perhaps you need to reconsider your application design?

                Pete Soheil DigiOz Multimedia http://www.digioz.com

                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