Sign in to follow this  
Followers 0
joemol

Automating custom controls

3 posts in this topic

I have used AutoIt v3 to automate a set of medical imaging programs. The project has been quite successful and I enjoy using this tool very much. However I still have a set of outstanding problems which need to be resolved to finalise the job. I would like to ask for suggestions as most of you are more familiar with AutoIt than I am.

In short, I have a custom control which resist all attempts at automation. (I have posted about this before, but I did make significant progress since then for similar controls.) In particular, I have a toolbar which is basically just a task selector. The bar itself responds only to MouseClick and does not recognise any other call, such as control enumeration.

There are ten "buttons" along it which are "clicked" to activate the associated functions. The buttons also respond to hover by changing colour. They are two dimensional only and have an icon-like symbol on one side and text displaying the related function in the middle. I have been unable to discover what they are or how they are implemented.

I have written several tools to dissect displayed screens and list the underlying window and child window tree(s). I have used all of the relevant APIs to bring controls to the top and probed them with _WinAPI_EnumWindows , ListWinWindowFromPoint, ChildWindowFromPoint and RealChildWindowFromPoint and everything else I could think of. Although these tools have been very successful in identifying my automation targets and have helped me greatly, this particular control reports no child windows or any structure whatsoever.

The questions I have are as follows,

1. What are the "buttons" likely to be? Could they be GDI+ regions which are painted on/off as the mouse hovers and clicks are detected? Has anyone had experience with this type of control?

2. Is there any way you know of, of detecting the region which lights up on hover? This would be sufficient for me to automate the bar. (Not nice, but sufficient!)

3. Has anyone been able to automate things like this by hooking the messages going to a custom control and deciphering the API calls?

4. Any other suggestions based on your experience as to how I could proceed?

I know that this is a very grey area in automating Windows but what I'm asking for is for your experiences in things which are (or could be) related to my problem.

The truly frustrating part is that there is absolutely no need for custom controls in this situation as they do nothing that an ordinary Win32 control (perhaps with some inheritance) couldn't do.

Help me Obi One. You are my last hope!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If we can't work with an example of the control, and you can't tell us anything about it then you are down to low-level sniffing of messages and other reverse-engineering techniques that are not within the scope of AutoIt.

:graduated:

Edit: Fixed link.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

There is one important difference between my previous post and this one. Since then I had managed to automate about half a dozen other custom controls, some far more complicated than this, using a variety of techniques and only AutoIt functions. I had hoped to be able to do the same with this last one.

I am aware of the difficulty of what I am asking for. The point of my post is that AutoIt is such a rich environment that despite all my hard work I may have missed something that someone else may have discovered in their own work. So I had to ask!

But thank you for your reply. You may be right. I may have to fire up my trusty Visual Studio once again, but if someone has any other suggestions for getting a handle on this problem it would still be greatly appreciated.

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