Jump to content
Sign in to follow this  
Champak

Windows 7 tooltip coloring

Recommended Posts

Champak

I was using the following code to color the tooltip in XP. I put it on another computer running 7 and it no longer colors the tips. Can someone show me what the new format is for 7?

ToolTip($s, 0, 0, "Battery Information", $icon)
        $H_TOOLTIP1 = WinGetHandle($s)
        DllCall("user32.dll", "int", "SendMessage", "hwnd", $H_TOOLTIP1, "int", $TTM_SETTIPBKCOLOR, "int", 2552550, "int", 0)

Share this post


Link to post
Share on other sites
ResNullius

I was using the following code to color the tooltip in XP. I put it on another computer running 7 and it no longer colors the tips. Can someone show me what the new format is for 7?

ToolTip($s, 0, 0, "Battery Information", $icon)
        $H_TOOLTIP1 = WinGetHandle($s)
        DllCall("user32.dll", "int", "SendMessage", "hwnd", $H_TOOLTIP1, "int", $TTM_SETTIPBKCOLOR, "int", 2552550, "int", 0)

According to MSDN

When visual styles are enabled, this message has no effect.

So, set the visual style/theme to none for the tooltip, then call it:

$s = "LOW"
ToolTip($s, 0, 0, "Battery Information");, $icon)
$H_TOOLTIP1 = WinGetHandle($s)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $H_TOOLTIP1, "wstr", "", "wstr", "")
DllCall("user32.dll", "int", "SendMessage", "hwnd", $H_TOOLTIP1, "int", 1043, "int", 2552550, "int", 0)
Sleep(1000)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.