Questions tagged [single-instance]

Make sure that only one instance of the application is running on the system.

250 questions
2
votes
1 answer

Syncing between multiple instances of the same program

I have quite a complicated programming problem on my hands, so bear with me for a few minutes. I decided i want to create a media player in WPF (C#) and i've run into a bit of a pickle. I want my application to be single instance, so that when the…
1
vote
4 answers

Windows.Forms: Activate an application that is already running in right FormWindowState

Our application has the following requirement: If the application is running and I start the application again, the first instance has to be activated instead to open a new instance. To realize this, in the main routine I check if there is already a…
rhe1980
  • 1,557
  • 1
  • 15
  • 36
1
vote
0 answers

Windows registry. Start single instance (not many) of application.

I have created a .NET application and I need to add a reference to it, to windows context menu. I've did it this way: added HKEY_CLASSES_ROOT\*\shell\myapp\command to my registry. It works but starts the same number of instances of my app as the…
1
vote
4 answers

not global Singleton design pattern?

Possible Duplicate: A Singleton that is not globally accessible Do you know a good design pattern that would make sure that only one instance of an object is created without making this object global in c++? That's what singleton do but I really…
koleror
  • 338
  • 1
  • 6
  • 22
1
vote
1 answer

Mutex fails to limit running applications to one

I am writing a program to format and aggregate data to make it processable for power automate. However, I just noticed that one of my applications is able to run more than once at the same time, even though I used a mutex to surpress that…
crafter32
  • 56
  • 8
1
vote
1 answer

Java reuse Dimension objects when setting component size

Is it contraindicated to use several presetted dimension objects to set the preferred size of non resizable components on the screen. E.g.: two textfields both should be 80x20 px so: Dimension d = new Dimension(80,…
zeller
  • 4,904
  • 2
  • 22
  • 40
1
vote
2 answers

C# Mutex how to stop my console app running multiple times

I have a console program, not that complicated but at the same time's not a hello world one. I have just two projects, first one has several classes. It is not multithreaded, and is all about calling restful APIs etc. The thing is this: I am trying…
Nick
  • 483
  • 1
  • 6
  • 15
1
vote
1 answer

How to restore the window allowing single instance of the application in c#?

i implemented allowing to open single instance of the application by using the following thread Restoring window from the system tray when allowing only one instance of that program it is working ,but the currently open window is not restoring.I…
User_MVC
  • 251
  • 2
  • 7
  • 21
1
vote
0 answers

Comunication between 2 processes using messages

Started here but still the question not closed - I think that I need to revise the whole architecture - so please give your opinions... Here is the how the application should work: An scheduler executes multiple time the same application, but with…
DreadAngel
  • 772
  • 11
  • 30
1
vote
1 answer

Scripts overlapping while running in Pycharm

screenshot of my pycharm interface Hey everyone. When I run this simple code (the tab 'youtubeyf.py is to print 'hello world'), it produces the intended result but also another script (with the tab name "yfinance.py") result as well. In fact, the…
1
vote
1 answer

Using Microsoft.VisualBasic.ApplicationServices to manage an application's single instance

I have managed to find the following code from StackOverflow: using Microsoft.VisualBasic.ApplicationServices; using System.Windows.Forms; namespace ExciteEngine2.MainApplication { public class SingleInstanceController:…
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91
1
vote
1 answer

Dictionary defined at Global.asax with Application.Add

I have below code at my ASP.NET 4.0 web application's Global.asax protected void Application_Start(object sender, EventArgs e) { Dictionary AllCompanyList = new Dictionary(); Application.Add("GlobalCompanyList",…
1
vote
0 answers

Launching share-activity multiple times on Android when using the singleInstance: Getting always the first URL

I have an Android-app in which I can save URLs from the browser via the share-functionality (I created a second share-activity with a send intent-filter) I tried to change the launchMode to all four different options, it works if on standard or top,…
pixx
  • 87
  • 1
  • 10
1
vote
0 answers

Mapview Instancing vs Google Maps API quotas

I am creating my first app on Android and it uses com.google.android.gms.maps.MapView in at least 3 activities and fragments. As such, I'm calling the following code in each activity onCreate to create a…
1
vote
0 answers

Ensure that long running SharePoint timer-job cannot start while previous instance is still running

What is the best practice to ensure that a SharePoint timer job runs only once? Using SPJobLockType.Job ensures that it is only started on one machine. But how do I prevent a new instance from being started while a previous instance is still…