Moin zusammen,
ich hoffe ihr könnt mir helfen. Wie ist es möglich aus einer Funktion eine dynamische Variable zu bekommen. Im folgenden Beispiel möchte ich gerne die Inhalte der Inputboxen ausgeben lassen?
AutoIt
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiIPAddress.au3>
#include <GuiConstants.au3>
Global $FONT = "Segoe UI"
Local $hGUI = GUICreate("Example")
GUISetBkColor(0xFFFFFF,$hGUI)
_GUICtrlTC_Station_Create(5, 5, "Rechner 01",$hGUI,$FONT)
_GUICtrlTC_Station_Create(5, 205, "Rechner 02",$hGUI,$FONT)
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _GUICtrlTC_Station_Create($iX, $iY,$StationName,$hWnd,$Fontname)
$GRREF = GUICtrlCreateGroup("", $iX, $iY, 306, 110)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($GRREF), "wstr", 0, "wstr", 0)
$REF = GUICtrlCreateCheckbox($StationName, $iX+5, $iY+82, 85, 20)
GUICheckBoxSetColor($REF, 0x3C3C3C, 0xFFFFFF, 9)
$IPADDREF = _GUICtrlIpAddress_Create($hWnd, $iX+90, $iY+15, 160, 25)
_GUICtrlIpAddress_SetFont($IPADDREF, $Fontname, 12, 400)
$INPUTUSERNAMEREF = GUICtrlCreateInput("", $iX+90, $iY+45, 160, 25)
GUICtrlSetFont(-1, 10, 400, 0, $FONT)
GUICtrlSetColor(-1, 0x3C3C3C)
$INPUTPASSWORDREF = GUICtrlCreateInput("", $iX+90, $iY+75, 160, 25, $ES_PASSWORD)
GUICtrlSetFont(-1, 9, 400, 0, $FONT)
GUICtrlSetColor(-1, 0x3C3C3C)
EndFunc
Func GUICheckBoxSetColor(ByRef $CtrlID, $iColor, $iBkColor = "0xF1EDED", $iSize = "10")
; SEuBo
$CtrlHWnd = $CtrlID
If Not IsHWnd($CtrlHWnd) Then $CtrlHWnd = GUICtrlGetHandle($CtrlID)
$aParent = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $CtrlHWnd)
$hOldG = GUISwitch($aParent[0])
$aCPos = ControlGetPos($aParent[0], "", $CtrlID)
$sOldT = GUICtrlRead($CtrlID, 1)
GUICtrlDelete($CtrlID)
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 0)
$CtrlID = GUICtrlCreateCheckbox($sOldT, $aCPos[0], $aCPos[1], $aCPos[2], $aCPos[3])
GUICtrlSetColor(-1, $iColor)
GUICtrlSetBkColor(-1, $iBkColor)
GUICtrlSetFont(-1, $iSize, 400, 0, $FONT)
DllCall('uxtheme.dll', 'none', 'SetThemeAppProperties', 'int', 7)
GUISwitch($hOldG)
EndFunc ;==>GUICheckBoxSetColor
Alles anzeigen