?
Solved

What win api functions to use to get data from a specific running window?

Posted on 2005-03-10
2
Medium Priority
?
366 Views
Last Modified: 2010-05-18
Hi all.
Please take a look at this image
http://www.poker-guide.org/empire_poker_table_large.jpg

this is a screenshot from an online poker site software. My question is:
How to work with this window in the picture and get data from it. Like for example, cards on the board and amount of chips in the middle. I dont need exact code. Just the technique and hopefully a list of api fucntions that can be beneficial(just started to learn api programming with delphi).
By the way these cards are birmap images stored in the game software program files folder and they are named like: 2c.bmp  for 2 clubs and kh.bmp for king hearts.

To make the questions scope more general. How to grap for example the result of a calculation displayed in windows calculator and display it in  edit1.text?

Answering either questions will do. Answering both will be great:)
Thanks

0
Comment
Question by:xo310
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 1000 total points
ID: 13514534
I guess the game is not within web browser...

First of all, download this tool:
http://www.greatis.com/delphicb/windowse/

It is always-on-top and will show you information about any specific component on the form.
Let's say you table (just for example):
  TGameRoom -> TPockerTable -> TCardSlot - TCard1
and all you have to do is to use 2 API functions - FindWindow and FindWindowEx. Example

var H : HWND;
begin
  H := FindWindow('TGameRoom', nil);   // Here you take TGameRoom
  if H <> nil then
    H := FindWindowEx(H, nil, 'TPockerTable', nil); // take TPockerTable ....
   ....
   etc

After you have the Handle of the component you need, you can send messages WM_GETTEXT, WM_SENDTEXT, WM_KEYDOWN, WM_CHAR, WM_LMOUSEDOWN, etc ... using SendMessage or PostMessage API functions.

This is the way to get data from this application, but if the cards are just images ... I am not sure if this can help you...
0
 

Author Comment

by:xo310
ID: 13515064
thank you very much. this is all i wanted.
Of course the game is not within the browser.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question