Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Users are clicking my application, 2x and 3x, getting the same application which is designed to RUN ONCE.

 

They click, it takes so long to load .dll's initially, they do it again because (for whatever reason). By that time, 2 or more app forms are on the screen.

 

 

How can I prevent against more than once instance of this application from loading? Please advise, thanks.

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Posted
Users are clicking my application, 2x and 3x, getting the same application which is designed to RUN ONCE.

 

They click, it takes so long to load .dll's initially, they do it again because (for whatever reason). By that time, 2 or more app forms are on the screen.

 

How can I prevent against more than once instance of this application from loading? Please advise, thanks.

 

Hi Drstein99,

 

This prevents your application from running twice...

System.Diagnostics.Process ThisProcess System.Diagnostics.Process.GetCurrentProcess();
System.Diagnostics.Process[] AllProcesses = System.Diagnostics.Process.GetProcessesByName(ThisProcess.ProcessName);

if (AllProcesses.Length > 1)
{
MessageBox.Show(ThisProcess.ProcessName + " is already executed", ThisProcess.ProcessName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}

Posted
Hi Drstein99,

 

This prevents your application from running twice...

System.Diagnostics.Process ThisProcess System.Diagnostics.Process.GetCurrentProcess();
System.Diagnostics.Process[] AllProcesses = System.Diagnostics.Process.GetProcessesByName(ThisProcess.ProcessName);

if (AllProcesses.Length > 1)
{
MessageBox.Show(ThisProcess.ProcessName + " is already executed", ThisProcess.ProcessName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}

 

Yea, it seemed like those other threads were very lengthy and had me running all over the place with different paths, all over. I'm going to give this quick solution a try, thank you.

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Posted

You could try getting a spalsh screen as well.

 

The reason they are launching your app several times is that they dont get feedback that it is starting. Displaying a splash screen to the user would solve that and would probably reduce the frustration.

For me personally, nothing feels as lousy as an app that does nothing the first 10 seconds after starting, and yes, i'm to lazy to open the taskmanager and check if it is working ;).

Nothing is as illusive as 'the last bug'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...