﻿#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <String.au3>
#include <WindowsConstants.au3>

Opt('GUIOnEventMode', 1)
Opt('OnExitFunc', 'Bye')

$iGUIWidth = @DesktopWidth / 4
$iGUIHeight = @DesktopHeight / 4
$iCount = 0

$iTest = _IIF(($iGUIHeight > (650 + 345) / 2), 200, 500)

AdlibEnable('_Test')
$sText = 'Beispiel'
$sText = _StringReverse($sText)

$hGui = GUICreate("Test", $iGUIWidth, $iGUIHeight)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetState()
Sleep(3000)
AdlibDisable()
ToolTip('')
_Exit()

Func OnAutoItStart()
    MsgBox(0, 'test', 'hallo')
EndFunc

Func OnAutoItExit()
   MsgBox(0, 'test', 'tschüss...')
EndFunc

Func Bye()
	MsgBox(0, 'test', 'und liebe Grüße ')
EndFunc

Func _Test()
	$iCount += 1
	ToolTip('AdlibEnable ' & $iCount)
EndFunc

Func _GDIPlus_CreateFontFamilyFromName($sFontname, $hCollection = 0)
	Local $aResult = DllCall($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $sFontname, 'ptr', $hCollection, 'ptr*', 0)
	If @error Then Return SetError(1, 0, 0)
	Return SetError($aResult[0], 0, $aResult[3])
EndFunc

Func _Exit()
	Exit
EndFunc
