private static bool hidded = true;
private void loop()
{
if (hidded == true)
{
Invoke(new Action(() =>
{
this.Hide();
}));
Thread.Sleep(300);
}
for (; ; )
{
int PID = Process.GetProcessesByName("ac_client");
if (PID == 0)//Uygulama bulunmadıysa çık
{
Application.Exit();
Environment.Exit(0);
}
bool flag = ((int)GetKeyState(45) & 32768) > 0;//INSERT
if (flag)
{
if (hidded == false)
{
hidded = true;
Invoke(new Action(() =>
{
this.Hide();
}));
Thread.Sleep(300);
}
else
{
hidded = false;
//sw1.Value = false;
Invoke(new Action(() =>
{
this.Show();
}));
Thread.Sleep(300);
}
}
}
}