请看代码...
调用TT弹出访问我的BLOG,
能不能像外挂一样最小化
让他自己管自己 别弹出来- -
Process p2 = new Process();
p2.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
为什么这句话没有效果。。没有做到using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using System.Timers;
using System.Management;namespace API
{
class Program
{
static Process p = new Process();
static Timer t = new Timer(3800);
static int n = 0;
static void Main()
{
t.Elapsed += new ElapsedEventHandler(run);
t.Start();
Console.ReadKey();
}
static void run(object sender, ElapsedEventArgs e)
{
if (n < 1)
{
Process p2 = new Process();
p2.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start("http://endlessw.blog.163.com/");
n++;
}
else
{
n = 0;
foreach (Process pp in Process.GetProcessesByName("TTraveler"))
{
pp.CloseMainWindow();
}
}
}
}
}
调用TT弹出访问我的BLOG,
能不能像外挂一样最小化
让他自己管自己 别弹出来- -
Process p2 = new Process();
p2.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
为什么这句话没有效果。。没有做到using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using System.Timers;
using System.Management;namespace API
{
class Program
{
static Process p = new Process();
static Timer t = new Timer(3800);
static int n = 0;
static void Main()
{
t.Elapsed += new ElapsedEventHandler(run);
t.Start();
Console.ReadKey();
}
static void run(object sender, ElapsedEventArgs e)
{
if (n < 1)
{
Process p2 = new Process();
p2.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start("http://endlessw.blog.163.com/");
n++;
}
else
{
n = 0;
foreach (Process pp in Process.GetProcessesByName("TTraveler"))
{
pp.CloseMainWindow();
}
}
}
}
}
Process p2 表示的是一个对象
Process.Start这是执行访问程序的
你用p2的样式怎么能控制Process.Start调用程序的样式呢?
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized; Process.Start(startInfo);