#include <GUIToolTip.au3>
#include <FontConstants.au3>
Global $aInfo[6][2] = [[ _
'Задание', '1'],[ _
'Номер ошибки', '2'],[ _
'Время начала', '3'],[ _
'Время окончания', '4'],[ _
'Время выполнения', '5'],[ _
'Описание ошибки', '6']]
$sText = ''
For $i = 0 To 5
_StringFormat($sText, $aInfo[$i][0], $aInfo[$i][1])
Next
$sText = StringTrimRight($sText, 1)
Func _StringFormat(ByRef $sText, $sString1, $sString2)
$sText &= StringFormat("%-18s: %s\n", $sString1, $sString2)
EndFunc
$hIcon = _WinAPI_LoadShell32Icon(15)
$hTool = _ToolTip($sText, 500, 300, 'Информация', $hIcon, $TTS_NOPREFIX + $TTS_BALLOON, 16, 'Consolas', 0x1EBFFF, 0x395A00)
$hFont = @extended
Sleep(1500)
For $i = 1 To StringLen($sText) - 1
_GUIToolTip_UpdateTipText($hTool, 0, 0, StringTrimRight($sText, $i))
Sleep(10)
Next
Sleep(500)
_GUIToolTip_UpdateTipText($hTool, 0, 0, $sText)
If $hFont Then _WinAPI_DeleteObject($hFont)
For $i = 1 To 5
_GUIToolTip_TrackPosition($hTool, Random(0, @DesktopWidth, 1), Random(0, @DesktopHeight, 1))
Sleep(400)
Next
_GUIToolTip_TrackPosition($hTool, 500, 300)
For $i = 1 To 4
_GUIToolTip_TrackActivate($hTool, False)
Sleep(500)
_GUIToolTip_TrackActivate($hTool)
Sleep(500)
Next
_GUIToolTip_Destroy($hTool)
Func _ToolTip($sText, $iX = 0, $iY = 0, $iTitle = '', $hIcon = 0, $iStyle = 0, $iFontSize = 0, $iFontFamily = 'Arial', $iFontColor = 0, $iBkColor = 0)
Local $hFont = 0, $iError = 0
Local $hTool = _GUIToolTip_Create(0, $iStyle)
If Not $hTool Then Return SetError(-1, 0, 0)
_GUIToolTip_SetMaxTipWidth($hTool, @DesktopWidth)
If $iFontSize Then
$hFont = _WinAPI_CreateFont($iFontSize, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, $iFontFamily)
If $hFont Then
_WinAPI_SetFont($hTool, $hFont)
Else
$iError += 1
EndIf
EndIf
If $iFontColor Then _GUIToolTip_SetTipTextColor($hTool, $iFontColor)
If $iBkColor Then _GUIToolTip_SetTipBkColor($hTool, $iBkColor)
If Not _GUIToolTip_AddTool($hTool, 0, $sText, 0, 0, 0, 0, 0, 2 + 16) Then Return SetError(1, 0, 0)
If $iTitle And Not _GUIToolTip_SetTitle($hTool, $iTitle, $hIcon) Then $iError += 2
_GUIToolTip_TrackPosition($hTool, $iX, $iY)
_GUIToolTip_TrackActivate($hTool)
Return SetError($iError, $hFont, $hTool)
EndFunc