I need to prevent the user from opening multiple instance of an application? If an instance is already running and if the user clicks on the exe icon i need to shift focus on the application which was opened?
Am able to display a MessageBox if there is already an instance running like:
Help me out?Code:if(System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).GetUpperBound(0)>=1) { MessageBox.Show("An Instance of the application is already open.","Press Inventory Management",MessageBoxButtons.OK,MessageBoxIcon.Information); this.Close(); }


Reply With Quote