Sign in to follow this  
Followers 0
h711

any ways to automate a Graphics Device Interface?

10 posts in this topic

I have a CD menu that is completed drawed by GDI. There is no standard API buttons. All text "buttons" are drawed and the action are detemined by mouse click based on position of the interface.

Any idea how to automate UI like this? Or if it is automateable at all?

Thanks!

Share this post


Link to post
Share on other sites



Use a seperate child process to emulate multitasking, or just work it into your main loop.


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites

Maybe you can explain this a little to an AutoIt newbie?

Share this post


Link to post
Share on other sites

*Sigh* Ok, get ready for a speech on code design.

OK, for most programs you write your going to want to follow a basic structure. This structure is:

1. Includes
2. Resource creation (creating GUI's, loading any data you need, variables etc.)
3. Main Loop
4. Your UDF's

So for any given program the first thing your going to do is add your #include<>'s. After that your going to have the lines of code that get any resources you need ready to use, like creating the GUI's or opening files. The the main part, your main loop. Your main loop is where you are going to put all the meat and potatoes of your program. All the code that needs to be running all the time is going to go here. For example, this is where all your code checking for user interaction is going to go. So basically anything that needs to be checked up on regularly will go here. Finally you place your UDF's. These are functions you have written yourself to carry out whatever you want your program to do. Traditionally these are called by your lines of code in the main loop.

All that is just a basic guideline but I think it should help you layout yourcode while you are learning the in's and out's of the language.


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites

thanks, but my question was "How to automate GDI?" not general GUI that use standard buttons.

The "autoit window info" tool cannot capture any thing on a GDI because they don't use standard buttons. Everything is drawed by GDI, and next action is based on the position of interface.

Maybe you can show me some example of how to deal with it.

Share this post


Link to post
Share on other sites

Ok, let me clarify somthing. Do you have the code to tell you when they select something on the menu? If you do then the above speech applies, you just have to think about it. You need to use the main loop part, and put your code there. Think about how GUIGetState is used and replace it with your code.

If you don't however and you are looking for that code, use a comparison to the client mouse coordnates.

Either way, the help file is your friend.


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

simply put. I only know how to code for the items that window info tool can capture. For that I can code based item properties such as id, instance, class, style.... If the tool cannot capture any thing, then I have no idea how to deal with it.

Edited by h711

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

The "button" location is defined in an INI file. I can try to read it and get that info, but it just make things pretty complicated. If there is an easy way to find where is the button from UI, and there are functions to deal with it from the UI, things should be much simpler.

Share this post


Link to post
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
Sign in to follow this  
Followers 0