h711 Posted September 17, 2008 Share Posted September 17, 2008 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! Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 17, 2008 Share Posted September 17, 2008 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 Link to comment Share on other sites More sharing options...
h711 Posted September 17, 2008 Author Share Posted September 17, 2008 Maybe you can explain this a little to an AutoIt newbie? Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 17, 2008 Share Posted September 17, 2008 *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 Link to comment Share on other sites More sharing options...
h711 Posted September 17, 2008 Author Share Posted September 17, 2008 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. Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 17, 2008 Share Posted September 17, 2008 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 Link to comment Share on other sites More sharing options...
h711 Posted September 17, 2008 Author Share Posted September 17, 2008 (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 September 17, 2008 by h711 Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 17, 2008 Share Posted September 17, 2008 If you know where the buttons are drawn just get the window size and position then move the mouse according to the positioning. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
h711 Posted September 17, 2008 Author Share Posted September 17, 2008 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. Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 17, 2008 Share Posted September 17, 2008 The only other way I can see is using PixelGetColor to check it's location. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now