Jump to content
Sign in to follow this  

Tab Control and Inconsistent Behavior

Recommended Posts


I am using AutoIt to automate some functionality in an external GUI application. I am trying to future-proof the script by using control names and text rather than hard coding indexes for the controls. I have run into some inconsistent behavior regarding the Tab controls and the _GUICtrlTab_xxxx functions.

Let's assume that I have correctly pulled the handle for the Tab Control. 

I am able to use the following functions successfully:

_GUICtrlTab_ClickTab($hTab, 1) ; Switches to the tab at index 1.

_GUICtrlTab_GetItemCount($hTab) ; Successfully returns the number of tabs in the control.

I am unable to use the following functions though:

_GUICtrlTab_FindTab($hTab, "Tab Text") ; Returns -1

_GUICtrlTab_GetItem($hTab, 1) ; Returns array {1, "", 0, ""} - So it is able to determine that the tab with the index of 1 is currently selected however the text is not returned.

Does anybody have any ideas? Do these functions only partially support external winforms gui?

Share this post

Link to post
Share on other sites

Are you passing in the actual handle to the conrol, or some other identifier.

Try passing in the return from controlgethandle, and attempt this one as well:


Doing the above, I can get the data I need from my companies application, but not guaranteed for all.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post

Link to post
Share on other sites

I am passing the actual handle returned by ControlGetHandle.

Trying _GUICtrlTab_GetItemText($hTab, 1) returns null.

Does this mean that these functions will have limited support for this particular application? Are there any options that I could set that would modify this behavior?


Edited by captainNcola

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