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. Word Capture

Word Capture

Scheduled Pinned Locked Moved C / C++ / MFC
help
8 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.
  • S Offline
    S Offline
    Swapnil Shah
    wrote on last edited by
    #1

    I want to capture Text Under Mouse pointer. I have used

    IAccessible::get_accName

    and

    IAccessible::get_accValue

    to find out Text Under Mouse using

    AccessibleObjectFromPoint

    . But I want just a word that is under mouse pointer. I am looking for any help. Thank you Regards, Swapnil Shah

    R 1 Reply Last reply
    0
    • S Swapnil Shah

      I want to capture Text Under Mouse pointer. I have used

      IAccessible::get_accName

      and

      IAccessible::get_accValue

      to find out Text Under Mouse using

      AccessibleObjectFromPoint

      . But I want just a word that is under mouse pointer. I am looking for any help. Thank you Regards, Swapnil Shah

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      See How to retrieve text under the mouse pointer[^]

      It is a crappy thing, but it's life -^ Carlo Pallini

      S 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        See How to retrieve text under the mouse pointer[^]

        It is a crappy thing, but it's life -^ Carlo Pallini

        S Offline
        S Offline
        Swapnil Shah
        wrote on last edited by
        #3

        I have already used IAccessible. This technique gives you a whole sentence. I am looking for word capture. I want to grab a word under mouse from any application. plz give me some suggestions. Regards, Swapnil Shah

        R 1 Reply Last reply
        0
        • S Swapnil Shah

          I have already used IAccessible. This technique gives you a whole sentence. I am looking for word capture. I want to grab a word under mouse from any application. plz give me some suggestions. Regards, Swapnil Shah

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Hi Swapnil, I am not able to instantly think of a technique to get this done. Probably you can use an OCR and get the word under the mouse cursor, and then search for it in the sentence that IAccessible returned. If it's present in the sentence, you could be double sure. Ya, I know it's dumb. But why not check if it goes through well? :-D I'll think on this line and write you another reply if I get a better idea.

          It is a crappy thing, but it's life -^ Carlo Pallini

          S 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Hi Swapnil, I am not able to instantly think of a technique to get this done. Probably you can use an OCR and get the word under the mouse cursor, and then search for it in the sentence that IAccessible returned. If it's present in the sentence, you could be double sure. Ya, I know it's dumb. But why not check if it goes through well? :-D I'll think on this line and write you another reply if I get a better idea.

            It is a crappy thing, but it's life -^ Carlo Pallini

            S Offline
            S Offline
            Swapnil Shah
            wrote on last edited by
            #5

            Hi Thanks for reply. I think i should try OCR. I have never used it but i have read that its highly unreliable. plz reply me if u get any better idea. Regards, Swapnil Shah

            R 1 Reply Last reply
            0
            • S Swapnil Shah

              Hi Thanks for reply. I think i should try OCR. I have never used it but i have read that its highly unreliable. plz reply me if u get any better idea. Regards, Swapnil Shah

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              Hi, Did you try using an OCR? I thought over your problem statement and I realise that it's even more complex than it sounds to be. Using the previous method I suggested, you could retrieve the entire text under the window. But, if you need the text (a word?) that's just under the mouse cursor, it would be easier if the text is selected. You could then use something like GetActiveWindow() followed a GetFocus(). If the text weren't selected, I can't think of a readily available technique to achieve this. You will have to do some research on it. If you do achieve it, that would make a nice article for CP. :)

              It is a crappy thing, but it's life -^ Carlo Pallini

              O 1 Reply Last reply
              0
              • R Rajesh R Subramanian

                Hi, Did you try using an OCR? I thought over your problem statement and I realise that it's even more complex than it sounds to be. Using the previous method I suggested, you could retrieve the entire text under the window. But, if you need the text (a word?) that's just under the mouse cursor, it would be easier if the text is selected. You could then use something like GetActiveWindow() followed a GetFocus(). If the text weren't selected, I can't think of a readily available technique to achieve this. You will have to do some research on it. If you do achieve it, that would make a nice article for CP. :)

                It is a crappy thing, but it's life -^ Carlo Pallini

                O Offline
                O Offline
                onlyjaypatel
                wrote on last edited by
                #7

                Hi, We have used the same code as given in http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx to capture objects under mouse in timer.But we are facing memory leakage problem. While debuging this code we got the point of leakage is in function AccessibleObjectFromPoint. We already using IAccesible::Release function and VariantClear to release memory but still memory leakage is there. Any one know ,how to release memory used when AccessibleObjectFromPoint is called. Please help. Thanx in advance. -Jay

                R 1 Reply Last reply
                0
                • O onlyjaypatel

                  Hi, We have used the same code as given in http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx to capture objects under mouse in timer.But we are facing memory leakage problem. While debuging this code we got the point of leakage is in function AccessibleObjectFromPoint. We already using IAccesible::Release function and VariantClear to release memory but still memory leakage is there. Any one know ,how to release memory used when AccessibleObjectFromPoint is called. Please help. Thanx in advance. -Jay

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #8

                  Hi, Use a forum appropriate to the topic to create a new thread. I have honestly not worked on this and so I won't be able to answer you. By creating a new thread, your question will be viewed by many people and some of them may be able to give you valuable inputs. I think you could safely use the COM forum for this query.

                  It is a crappy thing, but it's life -^ Carlo Pallini

                  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