Jump to content

Windows 7 tooltip coloring


Recommended Posts

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)
Link to comment
Share on other sites

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)
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...