none
AxMSTSCLib - Ctrl+Alt+Del RRS feed

  • Question

  • Hi there,

    I wonder if someone could help me?  I have created a Hyper-V console connect application using the code below.  This works great, however if the virtual machine is locked or logged off when connecting to it I am unable to send a CTRL+ALT+DEL (or CTRL+ALT+END) to the virtual machine.  I'm looking for the method that is used in the Microsoft vmconnect.exe application which as a button to send the keys.

    CODE:

                //specify the server the VM is running on
                axMsRdpClient8NotSafeForScripting1.Server = "x.x.x.x";

                //enable relative mouse mode and smart sizing
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings7.RelativeMouseMode = true;
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings7.SmartSizing = true;

                //specify the authentication service - this is required and set the authentication level
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings7.AuthenticationServiceClass =
                    "Microsoft Virtual Console Service";
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings6.AuthenticationLevel = 0;

                //retrieve the activeX control and enable CredSSP and disable NegotiateSecurity
                MSTSCLib.IMsRdpClientNonScriptable3 Ocx =
                    (MSTSCLib.IMsRdpClientNonScriptable3)axMsRdpClient8NotSafeForScripting1.GetOcx();
                Ocx.EnableCredSspSupport = true;
                Ocx.NegotiateSecurityLayer = false;

                //retrieve the activeX control and disable CredentialsDelegation
                MSTSCLib.IMsRdpExtendedSettings rdpExtendedSettings =
                    (MSTSCLib.IMsRdpExtendedSettings)axMsRdpClient8NotSafeForScripting1.GetOcx();
                object True = true;
                rdpExtendedSettings.set_Property("DisableCredentialsDelegation", ref True);

                //set the RDPPort and set the PCB string to the VM's ID
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings2.RDPPort = 2179;
                axMsRdpClient8NotSafeForScripting1.AdvancedSettings7.PCB = vmIDTextBox.Text;

                //connect to the VM
                axMsRdpClient8NotSafeForScripting1.Connect();

    Any help would be much appreciated!

    Thanks
    :)

    • Moved by Eason_H Tuesday, March 11, 2014 2:21 AM
    Monday, March 10, 2014 11:24 AM

All replies