retop89 Posted January 9, 2018 Posted January 9, 2018 Hi, I need help with the code expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $host = "" $hGUI = GUICreate("RDP Embedded Sessions", 952, 675, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $oRDP = ObjCreate("MsTscAx.MsTscAx.2") $oRDP_Ctrl = GUICtrlCreateObj($oRDP, 64, 44, 800, 600) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE) $oRDP.DesktopWidth = 800 $oRDP.DesktopHeight = 600 $oRDP.Fullscreen = False $oRDP.ColorDepth = 16 $oRDP.AdvancedSettings3.SmartSizing = True $oRDP.Server = $host $oRDP.UserName = "" $oRDP.Domain = "" $oRDP.AdvancedSettings2.ClearTextPassword = "" $oRDP.ConnectingText = "Connecting to " & $host $oRDP.DisconnectedText = "Disconnected from " & $host $oRDP.StartConnected = True $oRDP.RemoteProgramMode = True $oRDP.Connect() GUISetState(@SW_SHOW, $hGUI) ;~ ConsoleWrite($oRDP.GetErrorDescription() & @CRLF) $oRDP.ServerStartProgram (" -- LOCATION FILE --") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE $oRDP.Disconnect() Exit EndSwitch WEnd I want to run the program on RDP. I think that the formula is used for this: ServerStartProgram. Unfortunately, I don't know how to use it. $oRDP.ServerStartProgram ("-- LOCATION FILE --") - didn't work Can someone help me?
Earthshine Posted January 9, 2018 Posted January 9, 2018 (edited) look at the method. where did you get the code because clearly this was just an general example. https://msdn.microsoft.com/en-us/library/aa382952(v=vs.85).aspx Edited January 9, 2018 by Earthshine My resources are limited. You must ask the right questions
Earthshine Posted January 9, 2018 Posted January 9, 2018 I got this to open the form to connect by removing the failing line expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $host = "Build1" $hGUI = GUICreate("RDP Embedded Sessions", 952, 675, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $oRDP = ObjCreate("MsTscAx.MsTscAx.2") $oRDP_Ctrl = GUICtrlCreateObj($oRDP, 64, 44, 800, 600) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE) $oRDP.DesktopWidth = 800 $oRDP.DesktopHeight = 600 $oRDP.Fullscreen = False $oRDP.ColorDepth = 16 $oRDP.AdvancedSettings3.SmartSizing = True $oRDP.Server = $host $oRDP.UserName = "" $oRDP.Domain = "" $oRDP.AdvancedSettings2.ClearTextPassword = "" $oRDP.ConnectingText = "Connecting to " & $host $oRDP.DisconnectedText = "Disconnected from " & $host $oRDP.StartConnected = True $oRDP.RemoteProgramMode = True $oRDP.Connect() GUISetState(@SW_SHOW, $hGUI) ;~ ConsoleWrite($oRDP.GetErrorDescription() & @CRLF) ;~ $oRDP.ServerStartProgram ('') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE $oRDP.Disconnect() Exit EndSwitch WEnd My resources are limited. You must ask the right questions
retop89 Posted January 10, 2018 Author Posted January 10, 2018 13 hours ago, Earthshine said: I got this to open the form to connect by removing the failing line expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $host = "Build1" $hGUI = GUICreate("RDP Embedded Sessions", 952, 675, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $oRDP = ObjCreate("MsTscAx.MsTscAx.2") $oRDP_Ctrl = GUICtrlCreateObj($oRDP, 64, 44, 800, 600) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE) $oRDP.DesktopWidth = 800 $oRDP.DesktopHeight = 600 $oRDP.Fullscreen = False $oRDP.ColorDepth = 16 $oRDP.AdvancedSettings3.SmartSizing = True $oRDP.Server = $host $oRDP.UserName = "" $oRDP.Domain = "" $oRDP.AdvancedSettings2.ClearTextPassword = "" $oRDP.ConnectingText = "Connecting to " & $host $oRDP.DisconnectedText = "Disconnected from " & $host $oRDP.StartConnected = True $oRDP.RemoteProgramMode = True $oRDP.Connect() GUISetState(@SW_SHOW, $hGUI) ;~ ConsoleWrite($oRDP.GetErrorDescription() & @CRLF) ;~ $oRDP.ServerStartProgram ('') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE $oRDP.Disconnect() Exit EndSwitch WEnd Thx, but I want to run/open the application on the remote desktop. I think that "ServerStartProgram" is just for that, but I do not know how to use it in AutoIT. On the page with the method I was, however, I still can not use it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now