see my greatness :sweating:
#include <WinAPI.au3>
#include <WinAPIeX.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GuiImageList.au3>
#include <GuiButton.au3>
Local $upperBody = 0, $e = 0
$a = SubFunction__CpeateBalloonToolTipEX("dsgafhgadfhzdhzhdcxcxcxc", @DesktopWidth/2-55,@DesktopHeight/2, $upperBody)
$b = SubFunction__CpeateBalloonToolTipEX("dsgafhgadfhzdhzhdcxcxcxc", @DesktopWidth/2,@DesktopHeight/2+55, $upperBody)
While $e < 2
$nMsg = GUIGetMsg()
Switch $nMsg
Case $a[3];$GUI_EVENT_CLOSE
$e += GUIDelete ( $a[0] )
Case $b[3];$GUI_EVENT_CLOSE
$e += GUIDelete ( $b[0] )
EndSwitch
WEnd
Func SubFunction__CpeateBalloonToolTipEX($text, $pointX,$pointY, ByRef $upperBody)
Local $R, $Rn2, $thick, $beakLenX, $beakLenY, $textOffset, $ToolTipDeltaY, $ToolTipButtonH, $ToolTipButtonW, $textStringHeightMax
Local $ToolTipX, $ToolTipY, $ToolTipWidth, $ToolTipHeight, $ToolTipButtonY, $ToolTipLastButtonX, $ToolTipWidthRAW, $ToolTipHeightRAW, $ToolTipXRAW, $ToolTipYRAW
Local $tip, $Btn_Func, $Btn_EditPattern, $Btn_Close, $hDC, $hBrush, $rgn1, $rgn2, $ctrl_pos, $ctrl_rgn, $ctrlAttay, $testGUI, $testLabel, $LabelSize, $aPoint[3][2]
$R = 16
$Rn2 = $R*2
$thick = 24
$beakLenX = 33
$beakLenY = 33
$textOffset = 8
$ToolTipDeltaY = 0
$ToolTipButtonH = 24
$ToolTipButtonW = 24
$testGUI = GUICreate("",16,16,0,0)
$testLabel = GUICtrlCreateLabel("",0,0)
Local $LabelSize[2] = [ 333, 33];_GetTabbedStringSizeEx($testLabel, $text)
GUIDelete ( $testGUI )
$textStringHeightMax = $LabelSize[1]+8
$ToolTipX = 0
If $pointY < $upperBody Then
$ToolTipY = $upperBody - $pointY + $ToolTipDeltaY + $ToolTipButtonH/2 + 2
Else
$ToolTipY = $beakLenY + $ToolTipButtonH/2 + 2
EndIf
$ToolTipWidth = $LabelSize[0] + $R*2 + $textOffset*2
$ToolTipHeight = $ToolTipY + $textStringHeightMax + 16
$ToolTipButtonY = $ToolTipY - $ToolTipButtonH/2
$ToolTipLastButtonX = $ToolTipWidth - $R - $ToolTipButtonW
$ToolTipWidthRAW = $ToolTipWidth + $beakLenX
$ToolTipHeightRAW = $ToolTipHeight
$ToolTipXRAW = $pointX - $ToolTipWidthRAW
If $ToolTipXRAW+$R < 0 Then $ToolTipXRAW = -$R
$ToolTipYRAW = $pointY
$upperBody = $ToolTipYRAW + $ToolTipDeltaY + $ToolTipHeight
If ($ToolTipHeight - $R) < $thick Then
$thick = $ToolTipHeight - $R
EndIf
#Region ### START Koda GUI section ### Form=
$tip = GUICreate("Tip", $ToolTipWidthRAW, $ToolTipHeightRAW, $ToolTipXRAW, $ToolTipYRAW, BitOR($WS_POPUP,$DS_MODALFRAME,$DS_SETFOREGROUND),$WS_EX_TOPMOST)
WinSetTrans($tip, "", 255)
$Btn_Func = GUICtrlCreateButton("", $ToolTipLastButtonX-64, $ToolTipButtonY, $ToolTipButtonW, $ToolTipButtonH)
SubFunction__GUICtrlSetImage($Btn_Func, "shell32.dll", 55*4-3, 0)
$Btn_EditPattern = GUICtrlCreateButton("", $ToolTipLastButtonX-32, $ToolTipButtonY, $ToolTipButtonW, $ToolTipButtonH)
SubFunction__GUICtrlSetImage($Btn_EditPattern, "shell32.dll", 42*4-3, 0)
$Btn_Close = GUICtrlCreateButton("", $ToolTipLastButtonX, $ToolTipButtonY, $ToolTipButtonW, $ToolTipButtonH)
SubFunction__GUICtrlSetImage($Btn_Close, "shell32.dll", 28*4-3, 0)
GUICtrlCreateLabel("", $R+3, $ToolTipY + $ToolTipButtonH/2, $ToolTipWidth - $R - $R - 3, $textStringHeightMax, $SS_ETCHEDFRAME )
GUICtrlCreateLabel($text, $R+8+2, $ToolTipY + $ToolTipButtonH/2+2, $ToolTipWidth - $R - $R - 8-5, $textStringHeightMax-5 )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$hDC = _WinAPI_GetWindowDC($tip)
$hBrush = _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_ACTIVEBORDER))
Dim $aPoint[3][2] = [[$ToolTipWidth-$R, $ToolTipY],[$pointX-$ToolTipXRAW, 0],[$ToolTipWidth-$R/2, $ToolTipY+$thick]]
$rgn1 = _WinAPI_CreatePolygonRgn($aPoint)
$rgn2 = _WinAPI_CreateRoundRectRgn($ToolTipX, $ToolTipY, $ToolTipWidth, $ToolTipHeight, $Rn2, $Rn2)
_WinAPI_CombineRgn($rgn1, $rgn1, $rgn2, $RGN_OR)
_WinAPI_DeleteObject($rgn2)
$ctrl_pos = ControlGetPos($tip, "", $Btn_Func)
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($rgn1, $rgn1, $ctrl_rgn, $RGN_OR)
$ctrl_pos = ControlGetPos($tip, "", $Btn_EditPattern)
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($rgn1, $rgn1, $ctrl_rgn, $RGN_OR)
$ctrl_pos = ControlGetPos($tip, "", $Btn_Close)
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($rgn1, $rgn1, $ctrl_rgn, $RGN_OR)
_WinAPI_FrameRgn ( $hDC, $rgn1, $hBrush, 1, 1 )
_WinAPI_SetWindowRgn($tip, $rgn1)
_WinAPI_DeleteObject($hBrush)
_WinAPI_ReleaseDC($tip, $hDC)
Dim $ctrlAttay[4] = [$tip,$Btn_Func,$Btn_EditPattern,$Btn_Close]
Return $ctrlAttay
EndFunc
Func SubFunction__GUICtrlSetImage($hButton, $sFileIco, $iIndIco = 0, $iSize = 0)
Switch $iSize
Case 0
$iSize = 16
Case 1
$iSize = 32
Case Else
$iSize = 16
EndSwitch
Local $hImage = _GUIImageList_Create($iSize, $iSize, 5, 3, 6)
_GUIImageList_AddIcon($hImage, $sFileIco, $iIndIco)
_GUICtrlButton_SetImageList($hButton, $hImage,4)
Return $hImage
EndFunc