Home>
using system;
using system.windows.forms;
using system.runtime.interopservices;
using system.diagnostics;
namespace cmdform {
 public partial class form1:form {
  public form1 () {
   initializecomponent ();
  }
  private void button1_click (object sender, eventargs e) {
   process p=new process ();
   p.startinfo.filename="cmd.exe";//notepad.exe
   p.start ();
   system.threading.thread.sleep (100);
   setparent (p.mainwindowhandle, this.handle);
   showwindow (p.mainwindowhandle, 3);
  }
  [dllimport ("user32.dll", entrypoint="setparent")]
  private static extern intptr setparent (intptr hwndchild, intptr hwndnewparent);
  [dllimport ("user32.dll", entrypoint="showwindow")]
  public static extern int showwindow (intptr hwnd, int ncmdshow);
 }
}
c
  • Previous Detailed jQuery extend () and simple examples
  • Next Simple implementation of jQuery barrage effect