Sign in to follow this  
Followers 0
MatheFreak

ToolTip blocks WinActivate

2 posts in this topic

If I use 'ToolTip', my scripts don't work any longer.

Further windows simply dont get activated!

What am I doing wrong?? (using VBS with AutoItX3)

(I have tested with Sleep(), Timeout=... and WinList() too: window DOES exist)

Tested code, WORKING: :o

Set AI = WScript.CreateObject("AutoItX3.Control")
dummy = AI.Opt("WinTitleMatchMode", 2)

AI.WinActivate "Excel"             ' works fine
dummy = AI.WinWaitActive("Excel",,3) ' works fine
AI.send "{DOWN}"                     ' works fine

Tested code, NOT working: :)

Set AI = WScript.CreateObject("AutoItX3.Control")
dummy = AI.Opt("WinTitleMatchMode", 2)

AI.ToolTip "Waiting for Excel"     ' This line keeps rest from working!!!
                                     ' further windows simply don't get activated!
AI.WinActivate "Excel"             ' nothing happens
dummy = AI.WinWaitActive("Excel",,3) ' nothing happens
AI.send "{DOWN}"                     ' nothing happens

Share this post


Link to post
Share on other sites



Your usage for WinTitleMatchMode by substring is finding the ToolTip as it is the last active window with the substring to match.

This shows you the match.

Opt("WinTitleMatchMode", 2)
ToolTip('Some Excel Title')
If WinExists('Excel') Then
    MsgBox(0, Default, 'Title exists')
EndIf
OMG

Now I see!!!

ToolTip is findig himself!!

@MHz: Thanks a lot for this hint!!

So it's not a bug!

But how can I indicate with ToolTip "Im wating for SaveAs Dialog" without getting confused with the real "SaveAs Dialog"?

Do I have to something use like WinTitleMatchMode=4 ???

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