Results 1 to 2 of 2

Thread: find a window

  1. #1
    lurie is offline Member
    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default 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.

Similar Threads

  1. Closing secondary window from button in primary window
    By KoncentriK in forum New To Java
    Replies: 4
    Last Post: 02-26-2012, 02:24 AM
  2. Replies: 1
    Last Post: 07-25-2011, 11:24 AM
  3. How to find the active Window in Swing?
    By akcasoy in forum AWT / Swing
    Replies: 16
    Last Post: 06-26-2010, 06:33 PM
  4. Replies: 4
    Last Post: 01-10-2010, 08:48 AM
  5. change url in parent window from child window
    By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-09-2009, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •