需要自动运行一个程序,但有时候开启的时候会处于最小化或被切换到其他程序,而无法保证其主界面在前台显示,有何办法保证Process.Start开启的程序在前台谢谢!
解决方案 »
- 想做一个这样的界面,求类似源码
- 我在窗体中有一个Toolstrip,Toolstrip中添加一个ToolstripTextBox1,可是不管用TAB键,或用 ToolstripTExtbox1
- Framework 3.5安装问题
- 如何保存设计模式下UserControl控件中的DagaGridView子控件的DataGridViewColumn属性?
- .net怎么样把握他的核心
- 问一个简单的添加新字段到DataSet的问题
- 关于不规则EXCEL ADO.NET读取问题
- C#中将ACCESS的数据写入SQL SERVER,出错?在线等!
- 用控制台程序创建一个进程,并向这个进程发送消息?
- C#加密解密源码
- 怎样让xml有选择的绑定dataset
- C#对文件的访问权限
public static extern IntPtr FindWindow(string className, string windowName);[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool SetForegroundWindow(IntPtr hWnd);[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool IsIconic(IntPtr hWnd);[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool OpenIcon(IntPtr hWnd);private void button1_Click(object sender, EventArgs e)
{
IntPtr handle = FindWindow(null, "");
if (handle != IntPtr.Zero)
{
if (IsIconic(handle))
{
OpenIcon(handle);
}
else
{
SetForegroundWindow(handle);
}
}
}