[DllImport("user32.dll")]
public static extern void SetForegroundWindow(IntPtr hwnd);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(String classname, String title);
private void btn_OpenMini_Click(object sender, EventArgs e)
{
try
{
Process.Start(AppDomain.CurrentDomain.BaseDirectory.Trim() + "Mini.exe");
SetForegroundWindow(FindWindow(null,"彩铃DIY迷你首页"));
}
catch
{ }
}
public static extern void SetForegroundWindow(IntPtr hwnd);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(String classname, String title);
private void btn_OpenMini_Click(object sender, EventArgs e)
{
try
{
Process.Start(AppDomain.CurrentDomain.BaseDirectory.Trim() + "Mini.exe");
SetForegroundWindow(FindWindow(null,"彩铃DIY迷你首页"));
}
catch
{ }
}
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/archive/2010/04/30/1725116.html,如需转载请自行联系原作者