Jump to content

read text from another application tooltip


Recommended Posts

I see a lot of MTGO users are coming here to create tools to assist with card trading (bots, price fetchers, etc).

I have been working on a price helper that does the following:

1) User hovers over a card so it displays in the card preview area, then presses a hotkey (CTRL+P)

2) pixelchecksum on the card

3) if no price cache for checksum exists (step 4) else (step 9)

4) take a screenshot of the card (thanks to trid for his minicap code http://www.autoitscript.com/forum/index.php?showtopic=50933)

5) move the mouse to hover over the card so that it displays a tooltip

post-29058-1194941296_thumb.jpg

6) determine the size of the tooltip, then take a screenshot

7) translate the tooltip to text (thanks to ptrex for his OCR code http://www.autoitscript.com/forum/index.php?showtopic=50608)

8) lookup price from a site (download url then regex) or a csv file

9) display price in a tooltip

It was my first project, I was very happy about how easy it was to make something like this. However...

On the weekend I found a similar application called MTGO Pricer http://www.mtgopricer.com/.

It appears to collect data (csv, txt, etc) from various sites when it load, then when you hover over a card it INSTANTLY gets the price. It does just what my script does, without all the screen capture to ocr stuff.

The only way I can think it would do that, is that it is waiting for tooltips to display in the screen, and then reading what is in the tooltip.

I would love to know how it is being done. Would I search in memory to see if that tooltip is anywhere? Or can I read it some other way?

Any help, or tips on being able to get this piece of text would be most welcome.

-= CoRNeRNoTe =-

p.s. if anyone wants my source code then shoot me a PM, happy to share :P

Link to comment
Share on other sites

I'm sure it can be done, since Microsoft Narrator will read the contents of a tool-tip. You may have to look into hooking into a .DLL or something to read those contents. I'm not sure how to do it, but perhaps I pointed you in the correct direction. Check MSDN for tooltips.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Thanks for the tip Blue_Drache. Can you give me a push in the right direction with a tip on what to search for?

A search for "read tooltip" (and variants of that) doesn't give me anything useful and I am not 100% sure what I am looking for.

I have got myself a fair way but without a new lead I'm not sure where else to look.

Link to comment
Share on other sites

  • 3 years later...

Well I can figure out how to get the handle to a tooltip, but I can't figure out how to read anything in it. Even though the AutoIt Window Info Tool will tell me that the title is the text of the tip.

Yes i am also having the same problem dude not being able to interact with the system trap tool tips at all, would be nice if anyone could suggest a way this could be done?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...