Home > Windows API > Capturing text from under your mouse cursor!

Capturing text from under your mouse cursor!

Ever felt the need to capture text from under your mouse cursor. I’ve made a small sample application which does this. Check out!

Download (Rename to exe or save as exe)

Take a look at this screenshot, notepad contents has been captured into my application’s value field. Name and value are two different things. For e.g. for an Address bar in internet explorer name will be “Address bar” and value will be “the address”.

Now you may ask why I needed this kind of an application or what’s the use of this application. It’s pretty useful if you want to capture text from a control in a module. I’ve heard people say that “if only there was some way to capture text in a listbox”.  This tool even captures hyperlinks, menu names, toolbars, button captions, edit text, static control text, list control text, list box text too. Isn’t that cool. 8)

Another cool feature that I found was if you hover your mouse over a progress bar then the text is shown as 20%. 😉 8)

Take a look at the checkboxes given…

  1. You can automatically copy captured text to clipboard when you release your mouse.
  2. You can also hide this window as soon as you start dragging.
  3. Along with above features you can also make this a top most window.
  4. Also added another check box for killing this application on mouse up. [update]

So have fun capturing text, log your bugs as comments. This application is a very basic one but turned out to be useful for me.

Sourcecode(zip file, please rename to zip or save as zip). Full credit to this blogger(OldNewThing).

Known bugs…

  1. Does not capture text from list control second column onwards
  2. Does not capture text in Microsoft word documents
Advertisements
  1. Jignesh
    October 6, 2009 at 4:47 pm

    There is memory leakage in code.
    IAccessible pointer is not getting Released.
    Even though we do ->Release() then aslo leakage is there.

Comment pages
1 3 4 5
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: