Questions tagged [single-instance]

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

250 questions
2
votes
6 answers

How to find whether a given application is single instance or not?

I am looking for an efficient way to find whether a given application (say app.exe) is single instance or not? I thought of these following sols: Do CreateProcess() twice and check whether there are two or more instance running of that application?…
bayCoder
  • 1,345
  • 1
  • 11
  • 19
2
votes
1 answer

How to allow single instance application from the same directory but several instances from different directories in C#?

How could I allow a single instance application started from the same directory but several instances from different directories of the same executable ? More clearly, I want MyProgram.Exe to be run mono instance from "C:\Directory1" I…
user12805184
2
votes
2 answers

C# Make a class return its instance without a function or variable

So I've been working with classes with single instances in Unity for a while and generally do this: class PublicThings { public static PublicThings I; // instance of this class public int Score; void Start { I =…
nreh
  • 476
  • 8
  • 13
2
votes
1 answer

Android passing information to a SingleInstance Activity

I have a activity that displays a number of elements from a list that the user can scroll through. In addition from navigating the list for new elements added the user can click a popup notification to immediately goto that element. I only ever want…
isep
  • 703
  • 1
  • 9
  • 24
2
votes
1 answer

Is it possible to run only one instance of WiX msi at the same time?

I have .Net product with msi installer implemented using WiX. Now it is possible to run several instances of my installer at the same time. I am wondering whether it's possible to restrict run more than one instance of installer at the same…
Victor Haydin
  • 3,518
  • 2
  • 26
  • 41
2
votes
4 answers

Make a Single Capturing Lambda

This is obviously a toy example, but lets say I have a n functions like this: void one(const int param) { const auto func = [=](){ return 13 == param; }; } void two(const int param) { const auto func = [=](){ return 13 == param; }; } And…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
2
votes
1 answer

Limiting an ATL exe server to one process (instance) only

I have an ATL exe server written with C++ (Visual Studio 2010, with merging the proxy-stud dll). The executable is compiled for Windows 7 x86 & x64. The following happens on both architectures: The ATL exe server should function as a "server…
OmriSela
  • 566
  • 1
  • 6
  • 15
2
votes
2 answers

Do not destroy android activity and should not be in the history

I have a problem with Android and the transitions with activities. What I want to have is the following: MainActivity calls Activity B. Activity B calls MainActivity (for example, via Back Button, same instance) MainActivity calls the same instance…
user3215952
  • 223
  • 5
  • 11
2
votes
4 answers

Simple Communication between 2 instances of application

I have a WPF application that can take a few optional command line arguments. This application is also a single instance application (using a mutex to close any instances if one is already open). What I want for it to do though, is if something…
KyleGobel
  • 109
  • 1
  • 2
  • 7
2
votes
2 answers

Using single vim instance with --remote-silent

I've always been a console vim user, but lately I've tried to use gvim. I've made settings such that my console habits won't suffer, such as opening an urxvt terminal at the current directory with . However having multiple gvims and terminals open…
Masse
  • 4,334
  • 3
  • 30
  • 41
2
votes
0 answers

WCF Singleton with Session Id

I have a WCF service mapped to 1 hardware device (printer). I want to lock/unlock the printer by client. Is there a way to make a single instance of that service and also have session enabled? so i can get current user's session id? e.g…
Narcis
  • 5,862
  • 3
  • 23
  • 30
2
votes
1 answer

What is the best structure for Django project with multiple sites based on the same backend logic?

I've began working on a new large project - many city-based webshops, each working on its own subdomain of the one domain, for example, citydomain.webshop.com. There whould be about 40 of these websites at start to run simultaneously. Project's…
2
votes
1 answer

Single instance in the cluster with WF 4 and AppFabric

I am trying to do a single instance workflow with WF4 and AppFabric. I want just one instance of a workflow running in the cluster. I have tried a biztalk style: a method (CallService()) that creates the instance, and the same method in other…
Pablo Castilla
  • 2,723
  • 2
  • 28
  • 33
2
votes
2 answers

How To Allow Only One .Jar Instance, And To Let It Use Args From Other Attempted Instances?

I've got a tough question, for which I will first sketch a background to make things more understandable. Background I have made an audioplayer in Java which can be launched with command line args, and also without. The application's .jar (made with…
2
votes
6 answers

Using an empty file to have one application instance

There's probably other ways of doing this but I'd like to use an empty file to have one instance of an application running at a given time. This would be done by creating the file when the application is launched and have other application instances…
James P.
  • 19,313
  • 27
  • 97
  • 155