Beispiel #1
0
 public CmdExeGui cmd(string cmdToExecute, int postExecutionDelay)
 {
     //GuiHandle = CmdExeApi.currentWindow();
     CmdExeApi.hostCmd(cmdToExecute, postExecutionDelay);
     selectThis();
     return(this);
 }
Beispiel #2
0
        public void buildGui()
        {
            this.Width  = 400;
            this.Height = 300;
            // add controls
            var groupdBoxes = this.add_1x1("Help Commands", "Cmd.Exe GUI", false, 100);

            consoleOutTextBox = groupdBoxes[1].add_TextBox(true);
            consoleInTextBox  = consoleOutTextBox.insert_Above <TextBox>(20);
            var flowLayoutPanel = groupdBoxes[0].add <FlowLayoutPanel>();

            // setup events
            consoleInTextBox.onKeyPress(Keys.Enter, (text) => cmd(text));

            // finetune layout
            consoleOutTextBox.multiLine().scrollBars();

            // add helper comamnds

            flowLayoutPanel.add_Button("dir").onClick(() => cmd("dir"));
            flowLayoutPanel.add_Button("cd \\").onClick(() => cmd("cd \\"));
            flowLayoutPanel.add_Button("ipconfig").onClick(() => cmd("ipconfig"));
            flowLayoutPanel.add_Button("net users").onClick(() => cmd("net users"));
            flowLayoutPanel.add_Button("ping google").onClick(() => cmd("ping www.google.com"));
            flowLayoutPanel.add_Button("[show cmd.Exe]").onClick(() => CmdExeApi.showHost());
            flowLayoutPanel.add_Button("[stop cmd.Exe]").onClick(() => stop());
        }
Beispiel #3
0
 	public CmdExeGui()
 	{
 		CmdExeApi = new CmdExeApi(cmdProcessName, cmdStartArguments , dataReceived);	
 		//CmdExeApi.MinimizeHostWindow = tr;
 		buildGui();
 		CmdExeApi.start();   
 		CmdExeApi.hideHost();
 		//wait(500);
 		selectThis();
 		consoleInTextBox.focus();
 	}
Beispiel #4
0
 public CmdExeGui()
 {
     CmdExeApi = new CmdExeApi(cmdProcessName, cmdStartArguments, dataReceived);
     //CmdExeApi.MinimizeHostWindow = tr;
     buildGui();
     CmdExeApi.start();
     CmdExeApi.hideHost();
     //wait(500);
     selectThis();
     consoleInTextBox.focus();
 }
    	public void launch(string executableToLaunch)
    	{
    		if (pathToCdb.fileExists().isFalse())
    		{
    			"Aborting launch since could not find .NET Debugger (cdb.exe) in the expected path: {0}".error(pathToCdb);
    			return ;    		
    		}
			cmdApi = new CmdExeApi(pathToCdb, executableToLaunch , dataReceived);
    		cmdApi.MinimizeHostWindow = true;    		    			
    		cmdApi.start();    			    		    		
    		cmdApi.hostCmd(extraExecutionCommand);
    	}
Beispiel #6
0
 public void launch(string executableToLaunch)
 {
     if (pathToCdb.fileExists().isFalse())
     {
         "Aborting launch since could not find .NET Debugger (cdb.exe) in the expected path: {0}".error(pathToCdb);
         return;
     }
     cmdApi = new CmdExeApi(pathToCdb, executableToLaunch, dataReceived);
     cmdApi.MinimizeHostWindow = true;
     cmdApi.start();
     cmdApi.hostCmd(extraExecutionCommand);
 }
 	public CmdExeGui(string executable = "cmd.exe", string startArguments = "", Panel hostControl = null)
 	{
 		HostControl = hostControl ?? "CmdExe Gui".popupWindow(400,300);
 		cmdProcessName = executable;
 		cmdStartArguments = startArguments;
 		CmdExeApi = new CmdExeApi(cmdProcessName, cmdStartArguments , dataReceived);	
 		//CmdExeApi.MinimizeHostWindow = tr;
 		buildGui();
 		CmdExeApi.start();   
 		CmdExeApi.hideHost();
 		//wait(500);
 		selectThis();
 		consoleInTextBox.focus();
 	}
Beispiel #8
0
 public CmdExeGui(string executable = "cmd.exe", string startArguments = "", Panel hostControl = null)
 {
     HostControl       = hostControl ?? "CmdExe Gui".popupWindow(400, 300);
     cmdProcessName    = executable;
     cmdStartArguments = startArguments;
     CmdExeApi         = new CmdExeApi(cmdProcessName, cmdStartArguments, dataReceived);
     //CmdExeApi.MinimizeHostWindow = tr;
     buildGui();
     CmdExeApi.start();
     CmdExeApi.hideHost();
     //wait(500);
     selectThis();
     consoleInTextBox.focus();
 }
Beispiel #9
0
        public void buildGui()
        {
            //this.Width = 400;
            //this.Height = 300;
            // add controls
            var groupdBoxes = HostControl.add_1x1("Help Commands", "Cmd.Exe GUI", false, 100);

            consoleOutTextBox = groupdBoxes[1].add_TextBox(true);
            consoleInTextBox  = consoleOutTextBox.insert_Above <TextBox>(20);
            flowLayoutPanel   = groupdBoxes[0].add <FlowLayoutPanel>();

            // setup events
            consoleInTextBox.onKeyPress(Keys.Enter, (text) => cmd(text));

            // finetune layout
            consoleOutTextBox.multiLine().scrollBars();


            // add helper comamnds for cmd.exe
            if (cmdProcessName == "cmd.exe")
            {
                flowLayoutPanel.add_Button("dir").onClick(() => cmd("dir"));
                flowLayoutPanel.add_Button("cd \\").onClick(() => cmd("cd \\"));
                flowLayoutPanel.add_Button("ipconfig").onClick(() => cmd("ipconfig"));
                flowLayoutPanel.add_Button("net users").onClick(() => cmd("net users"));
                flowLayoutPanel.add_Button("ping google").onClick(() => cmd("ping www.google.com"));
                flowLayoutPanel.add_Button("[show cmd.Exe]").onClick(() => CmdExeApi.showHost());
                flowLayoutPanel.add_Button("[stop cmd.Exe]").onClick(() => stop());
            }
            else
            {
                flowLayoutPanel.splitContainer().panel1Collapsed(true);
                consoleOutTextBox.add_ContextMenu()
                .add_MenuItem("show console host window", true, () => CmdExeApi.showHost())
                .add_MenuItem("Send Ctrl+C to host", true, () => CmdExeApi.hostCmd_Ctrl_C());
            }

            //close cmd on form close
            HostControl.onClosed(() => stop());
        }
Beispiel #10
0
 // restore the focus on the current window (or every keypress from now on will be sent to the HostControl
 // this method should be called everytime we send a command to the CmdExeApi
 public CmdExeGui selectThis()
 {
     CmdExeApi.selectWindow(HostControl.Handle);
     consoleInTextBox.focus();
     return(this);
 }
Beispiel #11
0
 public CmdExeGui stop()
 {
     CmdExeApi.cmd("exit");
     CmdExeApi.hostStop();
     return(this);
 }
Beispiel #12
0
 // restore the focus on the current window (or every keypress from now on will be sent to the HostControl
 // this method should be called everytime we send a command to the CmdExeApi
 public CmdExeGui selectThis()
 {
     CmdExeApi.selectWindow(this.Handle);
     return(this);
 }