#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>


Login()
Test()

Func Login()
$LoginGUI = GUICreate("Password Dialog", 443, 186, -1, -1)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$LabelUser = GUICtrlCreateLabel("Username:", 8, 25, 70, 20)
$EnterUser = GUICtrlCreateInput("", 86, 25, 201, 21)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$LabelPass = GUICtrlCreateLabel("Password", 8, 60, 64, 20, 0)
$EnterPass = GUICtrlCreateInput("password", 86, 60, 200, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$LabelDomaene = GUICtrlCreateLabel("Domäne", 8, 95, 64, 20)
$EnterDomaene = GUICtrlCreateInput("sigg.zz", 88, 95, 201, 21)
$ButtonOk = GUICtrlCreateButton("&OK", 86, 130, 75, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 130, 75, 25, $BS_NOTIFY)
GUISetState(@SW_SHOW)

While 1
	$idMsg = GUIGetMsg()
        Switch $idMsg
			Case $ButtonOk
				Global $iUser = GUICtrlRead($EnterUser) ; Rückgabe des Eingabefeldes User
				Global $iPass = GUICtrlRead($EnterPass) ; Rückgabe des Eingabefeldes Pass
				Global $iDom = GUICtrlRead($EnterDomaene) ; Rückgabe des Eingabefeldes Domäne
			ExitLoop

			Case $ButtonCancel
				MsgBox($MB_SYSTEMMODAL, "Titel", "Anmeldung wurde durch Benutzer abgebrochen")
			ExitLoop

		EndSwitch
	WEnd

EndFunc	;==>Login

Func Test()
	ConsoleWrite ("User :" & " " & $iUser& @CRLF)
	ConsoleWrite ("Pass :" & " " & $iPass& @CRLF)
	ConsoleWrite ("Dom  :" & " " & $iDom & @CRLF)
EndFunc