find a window
I am making a program that helps me play hearts, cus I'm board, and have a question. Yes I'm fairly new to java so I think this is the right forum subsection. My question is: The program I am making needs to find the cards and get what cards I have in my hand. The way I was thinking about doing it is:
1. find the harts game window
2. get the origin or (x, y) coordinates of that window
3. find the cards using a screenshot
my problem with the above is:
How do I get my program to automatically find the harts game window and get its origin? The window is open as the game is running.
Re: find a window
If you're talking about getting the coordinates of another program that you're running, then you can't do that with just core Java and will require some OS calls. This will require JNA (Java Native Access) or JNI (Java Native Interface). For more on these guys, please check Google.