Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface AutoIt:将消息/键发送到GUICtrl(远程桌面)_User Interface_Desktop_Send_Autoit - Fatal编程技术网

User interface AutoIt:将消息/键发送到GUICtrl(远程桌面)

User interface AutoIt:将消息/键发送到GUICtrl(远程桌面),user-interface,desktop,send,autoit,User Interface,Desktop,Send,Autoit,我想使用autoIT向我的GUICtrl发送命令(windows+r)。当我发送(“#r”)时,它会在我的计算机上工作,而不是在远程桌面上。我想在RDP会话中这样做。有人能帮我吗?求你了 代码: $host = "" ;<<<<<<< enter here the host name or ip address $hGUI = GUICreate("Terminal server", 900, 700, -1, -1, $WS_OVERLAPPEDWIN

我想使用autoIT向我的GUICtrl发送命令(windows+r)。当我发送(“#r”)时,它会在我的计算机上工作,而不是在远程桌面上。我想在RDP会话中这样做。有人能帮我吗?求你了

代码:

$host = "" ;<<<<<<< enter here the host name or ip address
$hGUI = GUICreate("Terminal server", 900, 700, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$oRDP = ObjCreate("MsTscAx.MsTscAx.2")
$oRDP_Ctrl = GUICtrlCreateObj($oRDP, 0, 0, 900, 700)
GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE)
$oRDP.DesktopWidth = 900
$oRDP.DesktopHeight = 700
$oRDP.Fullscreen = False
$oRDP.ColorDepth = 16
$oRDP.AdvancedSettings3.SmartSizing = True
$oRDP.Server = $host
$oRDP.UserName = "" ;<<<<<<< enter here the user name
$oRDP.Domain = ""
$oRDP.AdvancedSettings2.ClearTextPassword = ""
$oRDP.ConnectingText = "Connecting to " & $host
$oRDP.DisconnectedText = "Disconnected from " & $host
$oRDP.StartConnected = True
$oRDP.Connect()

GUISetState(@SW_SHOW, $hGUI)


$oShel = ObjCreate("shell.application")
$oShel_Ctrl = GUICtrlCreateObj($oShel, 0, 0, 900, 700)
GUICtrlSetStyle($oShel_Ctrl , $WS_VISIBLE)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        $oRDP.Disconnect()
     Exit
EndSwitch

$host=”“ 通过RDP连接时,您需要使用特殊的快捷键。您可以在此处找到一个列表:

尝试发送ALT+HOME:

Send("{ALT}{HOME}")

我找到了解决办法。我使用PsExec.exe,更简单


PS:在选项之后不要忘记会话的ID。如果没有它,PsExec将工作,但仅在进程中,并且不会生成窗口

RDP会话窗口是否有焦点(是否处于活动状态)?我尝试使用ControlFocus,但不起作用:/I将在我的计算机上尝试使用PsExec,我认为PsExec出现,但仅在进程(服务任务管理器)中,但没有窗口。正常吗?