欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#實(shí)現(xiàn)在Form里面內(nèi)嵌dos窗體的方法

 更新時(shí)間:2015年09月04日 12:57:12   作者:我心依舊  
這篇文章主要介紹了C#實(shí)現(xiàn)在Form里面內(nèi)嵌dos窗體的方法,涉及C#針對Form窗體的設(shè)置及使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了C#實(shí)現(xiàn)在Form里面內(nèi)嵌dos窗體的方法。分享給大家供大家參考。具體如下:

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#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論