Sign in to follow this  
Followers 0
Newbie2

ToolTip

8 posts in this topic

Is it possible to perform a "WinExists" on a Tooltip in order to see if it exists?

Share this post


Link to post
Share on other sites



Yes. However, I'm not sure if you can detect a non-visible Tooltip or not. The title for a tooltip is whatever text it will display.

Share this post


Link to post
Share on other sites

10x, Valik.

I have decided to use PixelGetColor function to check if a tooltip exists, I have observed that when I use the AutoIt Window Spy and put the mouse on the yellow, I don't get the same decimal value of color when I move the cursor on the off the yellow. :D

Any suggestions?

Share this post


Link to post
Share on other sites

I can change the color of Tooltips at will, as can any user, so I wouldn't recommend using PixelGetColor() unless you plan to get the proper color at run-time.

And, as I suspected, AutoIt can't see a non-visible tooltip.

ToolTip("Line of text")
ToolTip("")
$hWnd = WinGetHandle("Line of text")
MsgBox(4096, "", $hWnd)

This shows an empty string. Comment out the 'ToolTip("")' line and it will return the HWND correctly.

So, if you know what text the tooltip will display, you can try WinExists() on that text, then when the tip is visible, it should return true.

Share this post


Link to post
Share on other sites

Valik,

I'm not sure I got it. Do you say that I cannot use PixelGetColor on a tooltip since it is not visible?

Share this post


Link to post
Share on other sites

I'm not sure I got it. Do you say that I cannot use PixelGetColor on a tooltip since it is not visible?

No, he's saying that you shouldn't plan on the color of the tooltips being the same. For example, my theme displays tooltips with a dark blue background and red text. Even if you planned on checking the color when you ran your script to get the proper color values, you still can't count on the font being the same for tooltip displays, so you might think you have the background color of the tooltip, but it might be the text color. Lastly, what's to prevent someone from using the same color as the tooltip background elsewhere on thier system (say, in their desktop pattern, or wherever) ?

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

Got it, pekster.

10x :D

Share this post


Link to post
Share on other sites

BTW - is it difficult to change the background color of a tooltip or SplashtextOn?

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