Jump to content
Sign in to follow this  
Vegar

func when variable change.

Recommended Posts

Vegar

Hello..

is there any way to call a func when a windowtilte change??

this is what i've tried:

if not $title=WinGetTitle ("winTitle -") then
$title = WinGetTitle ("Spotify -")
$location = StringMid ($title, 10)
ToolTip ($location)
endif
sleep(100)
wend

witch did not work...

Share this post


Link to post
Share on other sites
MDCT

You mean like this?

Run("notepad.exe")
WinWait("")
$handle = WinGetHandle("")
$Title1=WinGetTitle($handle)
While 1
    Sleep(50)
    if WinGetTitle($handle) <> $Title1 Then
        TitleChanged()
    EndIf
    Sleep(50)
WEnd

Func TitleChanged()
    Tooltip("Title has been changed",0,0)
    Sleep(4000)
    Tooltip("")
    $Title1=WinGetTitle($handle)
EndFunc

To try it, simply save the opened notepad as something, and the script will show a tooltip.

Hope this helps.

Share this post


Link to post
Share on other sites
Vegar

Thnx :D .. got it to work :D

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  

×