Thanks for your reply, but this does not work either:
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#NoTrayIcon
$width = 800
$height = 600
GUICreate("Extended Terminal Services Client", $width + 20, $height + 20, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$oRdpClient = ObjCreate("MsTscAx.MsTscAx")
$GUIActiveX = GUICtrlCreateObj($oRdpClient, 10, 10, $width, $height)
ObjEvent($oRdpClient, "Run_OnLoginComplete")
GUISetIcon("extsc.ico")
GUICtrlSetStyle($GUIActiveX, $WS_VISIBLE)
GUICtrlSetResizing ($GUIActiveX, $GUI_DOCKAUTO)
GUISetState()
$oRdpClient.Server = "myServer"
$oRdpClient.Domain = "myDomain"
$oRdpClient.UserName = "myUsername"
$oRdpClient.AdvancedSettings2.ClearTextPassword = "myPassword"
;$oRdpClient.DesktopWidth = 800
;$oRdpClient.DesktopHeight = 600
;$oRdpClient.ColorDepth = 16
;$oRdpClient.Fullscreen = True
;$oRdpClient.AdvancedSettings3.SmartSizing = True
$oRdpClient.ConnectingText = "Verbindung wird aufgebaut. Bitte warten..."
$oRdpClient.DisconnectedText = "Verbindung wurde getrennt."
$oRdpClient.Connect()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
Func Run_OnLoginComplete()
MsgBox(0, "Achtung", "Login Complete!")
EndFunc
GUIDelete()
Exit