#include <GUIConstantsEx.au3>
#include <FontConstants.au3>

Example()

Func Example()
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Citrix Receiver", 600, 300, 200)
	$idLabel1 = GUICtrlCreateLabel("Melden Sie sich an", 20, 20, 380, 45)
	GUICtrlSetFont($idLabel1, 24, $FW_BOLD,  0, "Courier New")
	$idLabel2 = GUICtrlCreateLabel("Domäne\Benutzer:", 20, 80, 120, 25)
	$idInput2 = GUICtrlCreateInput("", 150, 80, 420, 25)
	$idLabel3 = GUICtrlCreateLabel("Kennwort:", 20, 120, 80, 25)
	$idInput3 = GUICtrlCreateInput("", 150, 120, 420, 25)
    Local $idAnmelden = GUICtrlCreateButton("Anmelden", 190, 220, 100, 25)
    Local $idAbbrechen = GUICtrlCreateButton("Abbrechen", 310, 220, 100, 25)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

	Sleep(1000)

	; Benutzer
	ControlSetText("Citrix Receiver", "", "[CLASS:Edit; INSTANCE:1]", "Apfel")

	; Passwort
	ControlSetText("Citrix Receiver", "", "[CLASS:Edit; INSTANCE:2]", "4711Geheim!")

	; Absenden
	ControlClick("Citrix Receiver", "", "[CLASS:Button; INSTANCE:1]")

	Local $stext2 = ControlGetText("Citrix Receiver", "", $idInput2)
	Local $stext3 = ControlGetText("Citrix Receiver", "", $idInput3)

	MsgBox(0,"Anmeldedaten","Domäne\Benutzer: " & $stext2 & @CRLF & @CRLF & "Kennwort: " & $stext3)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idAbbrechen
                ExitLoop

        EndSwitch
    WEnd

    ; Delete the previous GUI and all controls.
    GUIDelete($hGUI)
EndFunc   ;==>Example
