Thread: [C#] - How can I use C # I get the position of each element in the program?

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    1

    [C#] - How can I use C # I get the position of each element in the program?

    Hello

    Topic say all ;P

    For example, let's say the window, the game:
    http://i40.tinypic.com/16a6yiw.jpg

    And how I can get position eg: Enter Game, Options, Exit Game .... ?

    I'v code to check window size:
    Code:
    IntPtr handle = Class1.WinApi.FindWindow(null, "Tibia");
                RECT clientRect = GetClientRect(handle);
                MessageBox.Show("Bottom " + clientRect.Bottom, "Info");
                MessageBox.Show("Left " + clientRect.Left, "Info");
                MessageBox.Show("Right " + clientRect.Right, "Info");
                MessageBox.Show("Top " + clientRect.Top, "Info");
    Result is:
    Bottom: 700
    Left: 0
    Right: 962
    Top: 0

    But, now... How i can get position of each button? (Enter game....)

    Please help

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    If they were windows buttons you would use winapi (maybe EnumChildWindows), but on a game they could just as easily be something else so you might not be able to

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If this game is not written in XNA or using .NET and/or the buttons are not actual GDI buttons then there is no way you can get the coordinates of them. Most games will be using Scaleform so the buttons and UI will be Flash-based or they are using hard-coded images and/or hard-coded coordinates for the buttons. They also could be in a data file somewhere.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Random char Array
    By peterderijp in forum C Programming
    Replies: 3
    Last Post: 09-30-2010, 06:41 AM
  2. Polynomials and ADT's
    By Emeighty in forum C++ Programming
    Replies: 20
    Last Post: 08-19-2008, 08:32 AM
  3. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  4. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  5. program position
    By monkeymon in forum Windows Programming
    Replies: 6
    Last Post: 05-23-2002, 12:18 AM