Sign in to follow this  
Followers 0
nokia6300

Which way is best to set windows title

6 posts in this topic

For example if I want to change the name of any window by using autoit command "WinSetTitle" then is it compulsory to get the windows name 1st by using "WinGetTitle" will it have the same effect if I direct re-labale any windows title for example if I write a codes as given below

$a = "Mozilla Firefox"

If WinExists ("Mozilla Firefox") Then
     WinSetTitle($a, "" , "Internet Explorer")
endif

the 2nd way is

$a = "Mozilla Firefox"
$b = WinGetTitle($a)

If WinExists ("Mozilla Firefox") Then
     WinSetTitle($b, "", "Internet Explorer")
Endif

what will be the difference in both above given examples?Are they work same??If not then elaborate the difference if U people can

Share this post


Link to post
Share on other sites



They should work the same

The only difference I would have expected is the use of $a in your second scriptlet

This uses $a and $b

$a = "Mozilla Firefox"
$b = "Internet Explorer"

If WinExists ($a) Then
     WinSetTitle($a, "", $B)
Endif

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

The former is not as specific as the later but in the same context both are relating to the same window. Both will retitle the "Somthing Forums - Mozilla Firefox" title to "Internet Explorer"

Share this post


Link to post
Share on other sites

This is a good ground to get onto however WinGetHandle would be the surest way of suceeding when the title changes

$hHandle = WinGetHandle("Mozilla Firefox")
If WinExists("$hHandle") Then
     WinSetTitle($hHandle, "" , "Internet Explorer")
EndIf

You mostly see that change when you opening and closing windows but yet the application stays, MDI documents at there best


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

Remember that these two programs, the ones you are relating to, will change the title immediately when the URL changes.

You also might want to look at Win Set Title Options in help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Using Firefox to view/use

$a = "Mozilla Firefox"

$a = "Which way is best to set windows title - AutoIt Forums - Mozilla Firefox"
$b = WinGetTitle($a)

If WinExists ("Which way is best to set windows title - AutoIt Forums - Mozilla Firefox") Then
     WinSetTitle($b, "", "Which way is best to set windows title - AutoIt Forums - nokia6300")
Endif

; Notice the nokia6300 is the change to the title of your Firefox browser....

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