Macaubal, para ser sincero nao gostei desse codigo de ToolTip do Treze, por isso estou te mandando uma dica muito boa....olha so, insira esse codigo em um modulo:
Option Explicit
Public Type RECT
Left As Long
Top As Long
Right As Long
bottom As Long
End Type
Public Type TOOLINFO
cbSize As Long
dwFlags As Long
hwnd As Long
dwID As Long
rtRect As RECT
hInst As Long
lpszText As Long
lParam As Long
End Type
Public Type ICCEX
dwSize As Long
dwICC As Long
End Type
Public Enum EditTipIcon
etiNone = 0
etiInfo = 1
etiWarning = 2
etiError = 3
End Enum
Public Enum TOOLSTYLE
szClassic = 1
szBalloon = 64
End Enum
Public Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Public Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cX As Long, ByVal cY As Long, ByVal wFlags As Long) As Long
Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (ByRef iccInit As ICCEX) As Long
Public Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Const HWND_TOPMOST As Long = -1
Public Const SWP_NOMOVE As Long = &H2
Public Const SWP_NOSIZE As Long = &H1
Public Const ICC_WIN95_CLASSES As Long = &HFF
Public Const CCM_Min As Long = &H2000
Public Const CCM_SETWINDOWTHEME As Long = (CCM_Min + &HB)
Public Const WM_USER As Long = &H400
Public Const CW_USEDEFAULT As Long = &H80000000
Public Const ECM_Min As Long = &H1500
Public Const EM_SHOWBALLOONTIP = ECM_Min + 3
Public Const WS_POPUP As Long = &H80000000
Public Const WS_EX_TOPMOST As Long = &H8&
Public Const TOOLTIPS_CLASSA As String = "tooltips_class32"
Public Const TTF_CENTERTIP As Long = &H2
Public Const TTF_SUBCLASS As Long = &H10
Public Const TTF_TRANSPARENT As Long = &H100
Public Const TTM_ADDTOOL As Long = (WM_USER + 4)
Public Const TTM_SETTIPBKCOLOR As Long = (WM_USER + 19)
Public Const TTM_SETTIPTEXTCOLOR As Long = (WM_USER + 20)
Public Const TTM_SETTITLE As Long = (WM_USER + 32)
Public Const TTS_ALWAYSTIP As Long = &H1
Public Const TTS_NOPREFIX As Long = &H2
'Constantes para os tipos de icones
Public Const TTI_ERROR As Long = 3
Public Const TTI_INFO As Long = 1
Public Const TTI_NONE As Long = 0
Public Const TTI_WARNING As Long = 2
Global ghWndTip As Long, ghWndParent As Long
Public Function IniciarBaloes(hWndParent As Long, Style As Long)
Dim hWndTip As Long, dwFlags As Long, ICEx As ICCEX
dwFlags = TTS_NOPREFIX Or TTS_ALWAYSTIP Or Style
With ICEx
.dwSize = Len(ICEx)
.dwICC = ICC_WIN95_CLASSES
End With
InitCommonControlsEx ICEx
hWndTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASSA, "", WS_POPUP Or dwFlags, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hWndParent, 0, App.hInstance, ByVal 0&)
If hWndTip = 0 Then Exit Function
SetWindowPos hWndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
IniciarBaloes = hWndTip
ghWndTip = hWndTip
ghWndParent = hWndParent
End Function
Public Sub CriarBalao(Object1 As Object, hWndOwner As Long, szText As String, Style As TOOLSTYLE, szCentered As Boolean, Optional szTitle As String, Optional mvarIcon As EditTipIcon, Optional BackColor As String, Optional ForeColor As String)
Object1.Tag = IniciarBaloes(hWndOwner, Style)
Dim tiInfo As TOOLINFO
With tiInfo
If szCentered = True Then
.dwFlags = TTF_SUBCLASS Or TTF_CENTERTIP Or TTF_TRANSPARENT
Else
.dwFlags = TTF_SUBCLASS Or TTF_TRANSPARENT
End If
.hwnd = hWndOwner
.lpszText = StrPtr(StrConv(szText, vbFromUnicode))
.hInst = App.hInstance
GetClientRect hWndOwner, .rtRect
.cbSize = Len(tiInfo)
End With
If szTitle <> "" Then
SendMessage ghWndTip, TTM_ADDTOOL, 0&, tiInfo
SendMessage ghWndTip, TTM_SETTITLE, CLng(mvarIcon), ByVal szTitle
SendMessage ghWndTip, TTM_SETTITLE, CLng(mvarIcon), ByVal szTitle
Else
SendMessage ghWndTip, TTM_ADDTOOL, 0&, tiInfo
End If
If BackColor <> "" Then
SendMessage ghWndTip, TTM_SETTIPBKCOLOR, BackColor, 0&
End If
If ForeColor <> "" Then
SendMessage ghWndTip, TTM_SETTIPTEXTCOLOR, ForeColor, 0&
End If
End Sub
Agora faça um teste, em um formulario coloque um CommandButtom e insira isso no Form_load:
CriarBalao Command1, Command1.hwnd, "Teste de balões", szBalloon, False, "Balão",_ etiInfo
Onde é passado um objeto(CommandButton), a handle do objeto, o texto do balão, o estilo de balão, se ele vai ser centralizado ou não (true ou false), o titulo, o icone e por opcional (que nao esta sendo usado no codigo acima) a cor do texto e do fundo. Repare que pode ser qualquer objeto.
Me desculpe se nao inseri comentarios mas acho que isso ja e o suficiente.
Até!!!!