Jump to content

GuiToolTip, no border


Eiyu
 Share

Recommended Posts

Hello

I would like to remove the borders of my tooltip
I cannot , after several internet searches, I have not found

I like to have white text on a black background in the frame
Here's what I have so far :

#include <GuiToolTip.au3>
#include <WindowsConstants.au3>

Func _GUIToolTip_CreateToolTip($hWnd, $sTitle, $sText, $iStyle = Default, $iX = -1, $iY = -1, $iFlags = 0, $iColTxt = Default, $iColBk = Default, $iIcon = 0)
    Local Const $CW_USEDEFAULT = 0x80000000
    If Not IsHWnd($hWnd) Or IsKeyword($hWnd) Then $hWnd = 0
    If IsKeyword($iX) Or $iX < 0 Or Not IsNumber($iX) Then $iX = 0
    If IsKeyword($iY) Or $iY < 0 Or Not IsNumber($iY) Then $iY = 0
    If IsKeyword($iFlags) Or $iFlags <= 0 Or Not IsNumber($iFlags) Then $iFlags = 40
    If IsKeyword($iStyle) Then $iStyle = BitOR($TTS_BALLOON, $TTS_CLOSE)
    Local $hTip = _WinAPI_CreateWindowEx($WS_EX_TOPMOST, "tooltips_class32", "", BitOR($iStyle, $TTS_ALWAYSTIP, $TTS_NOPREFIX), $CW_USEDEFAULT, $CW_USEDEFAULT, $CW_USEDEFAULT, $CW_USEDEFAULT, $hWnd)
    _GUIToolTip_AddTool($hTip, $hWnd, $sText, $hWnd, 0, 0, 0, 0, $iFlags, 0)
    If Number($iIcon) > 3 And @OSVersion = "WIN_XP" And Number(StringRight(@OSServicePack, 1)) < 2 Then $iIcon = 0
    If Not IsNumber($iIcon) Or $iIcon < 0 Then $iIcon = 0
    _GUIToolTip_SetTitle($hTip, $sTitle, $iIcon)
    If IsInt($iColTxt) Then _GUIToolTip_SetTipTextColor($hTip, $iColTxt)
    If IsInt($iColBk) Then _GUIToolTip_SetTipBkColor($hTip, $iColBk)

    If $hWnd = 0 Or $hWnd = -1 Or IsKeyword($hWnd) Then
    _GUIToolTip_TrackActivate($hTip, True, $hWnd, $hWnd)
    EndIf

    Return $hTip
EndFunc   ;==>_GUIToolTip_CreateToolTip

Func _SetTipColors($hWnd, $iBkColor, $iTxtColor)
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hWnd, "wstr", "", "wstr", "")
    DllCall("user32.dll", "int", "SendMessage", "hwnd", $hWnd, "int", $TTM_SETTIPBKCOLOR, "int", _RGB2BGR($iBkColor), "int", 0)
    DllCall("user32.dll", "int", "SendMessage", "hwnd", $hWnd, "int", $TTM_SETTIPTEXTCOLOR, "int", _RGB2BGR($iTxtColor), "int", 0)
EndFunc   ;==>_SetTipColors

Func _RGB2BGR($iColor)
    Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF)
 EndFunc   ;==>_RGB2BGR

Global $hToolTip = _GUIToolTip_CreateToolTip(0, "", "Test", 0, 0, 0, 0, 0, 0xFFFFFF)
_SetTipColors($hToolTip, 0x000000, 0xFFFFFF)

While 1
Wend

Thank you in advance :bye:

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