I have an application for which i ve an icon in system tray.
Whenver system boots the icon appears in the system tray as i ve written the application path in
the registry.
I made the form visible property in load as false so the form is nt displayed
when the sysem boots...only the icon is displayed in the system tray.
Now my problem is that when i double click the shortcut icon also the form does'nt
get displayed.
What I want is that when application boots the form should'nt get displayed but
when i double clicked the shortcut or EXE it should get displyed.
I am also checking at launch time whether the applicaion is allready running. If it is
running then what i need to do is to make the allready running form (which is minimise to
system tray) visible.
I wrote some code in Programe.cs file in order to check the application is allready running.
Programe.cs codes : -
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (CheckAppAllreadyRunning() == true)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Login());
}
}
private static bool CheckAppAllreadyRunning()
{
/* Checking at launch time whether the application is allready running */
bool flag = true;
Process[] allProcess = Process.GetProcesses();
int counter = 0;
foreach (Process p in allProcess)
{
if (string.Equals("YuntaaDeskNew", p.ProcessName.ToString()))
{
counter++;
}
}
if (counter == 1)
{
// count = counter;
return true;
}
else
{
Login frm = new Login();
frm.NotifyYuntaaDesk.Visible = false;
//frm.ShowDialog();
frm.WindowState = FormWindowState.Normal;
return false;
}
}
Login Form code : -
private void Login_Load(object sender, EventArgs e)
{
this.visible = false;
}
is it posible if the application is allready running then on double click of shortcut or EXE just
make the running form from system tray visible. If i double click the system tray icon then it is fine.
The only problem is when i double click the shortcut icon.
Sorry for taking ur valuable time.....
If possible help plz....

1 answers
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!