Sign in to follow this  
Followers 0
wolfbartels

How to get the Text on Tab

6 posts in this topic

Please,

Is there a way to get the TEXT (label) on the current Tab shown of a SysTabControl32?

The function ControlCommand ( "title", "text", controlID, "CurrentTab" ) returns the number and not the lable text.

Share this post


Link to post
Share on other sites



Please,

Is there a way to get the TEXT (label) on the current Tab shown of a SysTabControl32?

The function ControlCommand ( "title", "text", controlID, "CurrentTab" ) returns the number and not the lable text.

Surprised no one has done it... Have you checked PaulIA's AU3Lib.au3 in the Examples Script forum?

If not, these may help you get you started:

http://msdn2.microsoft.com/en-us/library/ms650940.aspx

http://msdn2.microsoft.com/en-us/library/ms650986.aspx


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What about something like

$Wintitle='Systemeigenschaften'
$Wintext='Systemleistung' ; the text that's only in the special tab

While Not StringInStr (WinGetText($Wintitle), $Wintext)
    ControlSend($Wintitle, '', '', '+^{Tab}')
WEnd

I know that's not the solution, but a workaround if the text changes within the tab - and I could bet that it does.

Edited by dabus

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What about something like

$Wintitle='Systemeigenschaften'
$Wintext='Systemleistung' ; the text that's only in the special tab

While Not StringInStr (WinGetText($Wintitle), $Wintext)
    ControlSend($Wintitle, '', '', '+^{Tab}')
WEnd

I know that's not the solution, but a workaround if the text changes within the tab - and I could bet that it does.

Thanks, it works. It is better to use

While Not StringInStr (WinGetText($Wintitle), $Wintext)=1

because $Wintext may appear somewhere else among the text. The window text always begins with the Tabs Label.

Edited by wolfbartels

Share this post


Link to post
Share on other sites

Thanks, it works. It is better to use

While Not StringInStr (WinGetText($Wintitle), $Wintext)=1

because $Wintext may appear somewhere else among the text. The window text always begins with the Tabs Label.

StringInStr() returns a boolean. There is no need to add "= 1" to it.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

StringInStr() returns a boolean. There is no need to add "= 1" to it.

Sorry, acording to HELP:

StringInStr

--------------------------------------------------------------------------------

Checks if a string contains a given substring.

StringInStr ( "string", "substring" [, casesense [, occurrence]] )

.............

Return Value

Success: Returns the position of the substring.

Failure: Returns 0 if substring not found.

that is a number, not a boolean. I checked it.

Remember: It's not what you know .... It's what you can prove!

Edited by wolfbartels

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