Jump to content

ToolTip blocks WinActivate


MatheFreak
 Share

Recommended Posts

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
Link to comment
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 ???

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...