Drstein99 Posted January 10, 2005 Posted January 10, 2005 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. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Administrators PlausiblyDamp Posted January 10, 2005 Administrators Posted January 10, 2005 http://www.xtremedotnettalk.com/showthread.php?t=90330 may be worth a read Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
EFileTahi-A Posted January 12, 2005 Posted January 12, 2005 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); } Quote
Drstein99 Posted January 14, 2005 Author Posted January 14, 2005 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. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Wile Posted January 14, 2005 Posted January 14, 2005 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 ;). Quote Nothing is as illusive as 'the last bug'.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.