I need a way to make my app to do this: run by windows running (I did it) then if the user exits the program it hides by this method
Form1 form = (Form1)sender;
form.ShowInTaskbar = false;
form.Location = new Point(10000, 10000);
btw I made a method in the program.cs file by the help of a member that checks if there any instance is running here it is
[STAThread]
static void Main()
{
Mutex mutex = new System.Threading.Mutex(false, "MyUniqueMutexName");
try
{
if (mutex.WaitOne(0, false))
{
// Run the application
}
else
{
MessageBox.Show("there is already a running instance of this program", "info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
finally
{
if (mutex != null)
{
mutex.Close();
mutex = null;
}
}
}
what I want from my program is like the following: I don't want the program to open another instance while there is already an open one I need to find a way to make the program to just make the hidden one to be visible
btw English isn't my mother language so please don't complain last thing I want to tell you guys that I am a 13-year-old programmer