Hier mal ein Beispiel, wie du die Funktion nutzen kannst...
Spoiler anzeigen
#NoTrayIcon
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
_GDIPlus_Startup ()
Opt ("GUIOnEventMode", 1)
Global Const $i_WIDTH = 400, $i_HEIGHT = 200
[/autoit] [autoit][/autoit] [autoit]Global $h_Gui = GUICreate ("", $i_WIDTH, $i_HEIGHT)
Global $h_Graphics = _GDIPlus_GraphicsCreateFromHWND ($h_Gui)
GUISetOnEvent (-3, "_Exit", $h_Gui)
OnAutoItExitRegister ("_OnExit")
GUISetState (@SW_SHOW, $h_Gui)
_GDIPlus_GraphicsDrawStringCustom ($h_Graphics, 'Dein String', 20, 50, 11.5, 0xFFFF0000)
_GDIPlus_GraphicsDrawStringCustom ($h_Graphics, '_GDIPlus_GraphicsDrawStringCustom', 20, 100, 9, 0xFF333333, 0, 1, 'Arial')
While Sleep (10000)
WEnd
Func _Exit ()
Exit
EndFunc ;==> _Exit
Func _OnExit ()
_GDIPlus_GraphicsDispose ($h_Graphics)
_GDIPlus_Shutdown ()
EndFunc ;==> _OnExit
; #FUNCTION# ===================================================================
; Name ..........: _GDIPlus_GraphicsDrawStringCustom
; Description ...: Draw a customized string
; AutoIt Version : v3.3.6.1
; Syntax ........: _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color[, $i_Align = 0[, $i_Weight = 0[, $s_Font = 'Tahoma']]])
; Parameter(s): .: $h_Graphics - Handle to a Graphics object
; $s_String - String to be drawn
; $i_X - X coordinate where the string will be drawn
; $i_Y - Y coordinate where the string will be drawn
; $n_Size - Font size to use for drawing
; $b_Color - Alpha, Red, Green and Blue components
; $i_Align - The alignment can be one of the following:
; |0 - The text is aligned to the left
; |1 - The text is centered
; |2 - The text is aligned to the right
; $i_Weight - The style of the typeface. Can be a combination of the following:
; |0 - Normal weight or thickness of the typeface
; |1 - Bold typeface
; |2 - Italic typeface
; |4 - Underline
; |8 - Strikethrough
; $s_Font - Name of the Font Family
; Return Value ..: Success - True
; Failure - False
; Author(s) .....: $var
; ==============================================================================
Func _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color, $i_Align = 0, $i_Weight = 0, $s_Font = 'Tahoma')
Local $a_CreateSolidFill, $a_CreateStringFormat, $a_CreateFontFamilyFromName, $a_CreateFont, $t_Struct, $p_Layout, $a_Return
$a_CreateSolidFill = DllCall ($ghGDIPDll, 'int', 'GdipCreateSolidFill', 'int', $b_Color, 'dword*', 0)
$a_CreateStringFormat = DllCall ($ghGDIPDll, 'int', 'GdipCreateStringFormat', 'int', 0, 'word', 0, 'ptr*', 0)
$a_CreateFontFamilyFromName = DllCall ($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $s_Font, 'ptr', 0, 'handle*', 0)
$a_CreateFont = DllCall ($ghGDIPDll, 'int', 'GdipCreateFont', 'handle', $a_CreateFontFamilyFromName[3], 'float', $n_Size, 'int', $i_Weight, 'int', 3, 'ptr*', 0)
$t_Struct = DllStructCreate ($tagGDIPRECTF)
$p_Layout = DllStructGetPtr ($t_Struct)
DllStructSetData ($t_Struct, 'X', $i_X)
DllStructSetData ($t_Struct, 'Y', $i_Y)
DllStructSetData ($t_Struct, 'Width', 0)
DllStructSetData ($t_Struct, 'Height', 0)
DllCall ($ghGDIPDll, 'int', 'GdipSetStringFormatAlign', 'handle', $a_CreateStringFormat[3], 'int', $i_Align)
$a_Return = DllCall ($ghGDIPDll, 'int', 'GdipDrawString', 'handle', $h_Graphics, 'wstr', $s_String, 'int', -1, 'handle', $a_CreateFont[5], _
'ptr', $p_Layout, 'handle', $a_CreateStringFormat[3], 'handle', $a_CreateSolidFill[2])
Return $a_Return[0] = 0
EndFunc ;==> _GDIPlus_GraphicsDrawStringCustom