single-instance

VB6: Single-instance application across all user sessions

删除回忆录丶 提交于 2019-12-04 03:27:58
问题 I have an application that needs to be a single-instance app across all user sessions on a Windows PC. My research thus far has centered around using a mutex to accomplish this, but I am having an issue that I am not sure is really an issue, this is really a best-practice question I believe. Here's the code first of all: Private Const AppVer = "Global\UNIQUENAME" ' This is not what i am using but the name is unique Public Sub Main() Dim mutexValue As Long mutexValue = CreateMutex(ByVal 0&, 1,

Android singletop singleinstance and singletask

你。 提交于 2019-12-04 03:18:09
I've an design issue in implementing different types of launchmode for different activities. I've 5 Activities. VideoList VideoDetail FavoritesList VideoSearch VideoPlayer When the user starts the app it goes to VideoList that displays list of videos. Clicking on any of the Videos take them to VideoDetails.There are two button in that page. Play Button and Add to Favorites Button. I've a Footer bar on all the pages. Footer bar contains three image button. 1 HOME - Takes the user to first page- video list page 2 FAVORITES LIST - Show the list of favorites video. Clicking on any one of the

What is the best way to make a single instance application in Compact Framework?

偶尔善良 提交于 2019-12-03 20:40:50
I've seen all the answers for the standard framework What is the correct way to create a single instance application? Prevent multiple instances of a given app in .NET? What is the best way to make a single instance application in .net? How do I check whether another process with the same name exists using the compact framework? The 3 parameter constructor is not supported by the CF Process GetProcessByName is not supported by the CF OpenNETCF gives you class OpenNETCF.Threading.NamedMutex that let's you create system-wide named mutex. http://www.opennetcf.com/library/sdf/html/40db385b-e21b

How to make sure that there is one instance of the application is running

核能气质少年 提交于 2019-12-03 14:02:10
问题 I want to check when the user double click on applictaion icon that no another instance of this application is already running. I read about My.Application but i still don't know what to do. 回答1: The most common pattern for doing this is to use the Singleton pattern. As you haven't indicated a language, I'm going to assume that you are referring to C# here - if not, the principles are still the same in most OO languages. This article should give you some help. 回答2: This is something I've used

How to make sure that there is one instance of the application is running

陌路散爱 提交于 2019-12-03 03:21:52
I want to check when the user double click on applictaion icon that no another instance of this application is already running. I read about My.Application but i still don't know what to do. Pete OHanlon The most common pattern for doing this is to use the Singleton pattern. As you haven't indicated a language, I'm going to assume that you are referring to C# here - if not, the principles are still the same in most OO languages. This article should give you some help. This is something I've used... (C# on .NET 2.0) [STAThread] private static void Main(string[] args) { //this follows best

How to enforce single instance of an application under mono?

狂风中的少年 提交于 2019-12-02 04:25:37
问题 So, I am able to enforce single instance of my application on Windows as follows. [STAThread] class method Program.Main(args: array of string); begin var mutex := new Mutex(true, "{8F6F0AC4-B9A1-45fd-A8CF-72F04E6BDE8F}"); if mutex.WaitOne(Timespan.Zero, true) then begin Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += OnThreadException; lMainForm := new MainForm; lMainForm.ShowInTaskbar := true; lMainForm.Visible := false;

Making a singleton application across all users

こ雲淡風輕ζ 提交于 2019-12-02 03:28:30
问题 I'm trying to create an application which only allows a single instance across all Windows users. I'm currently doing it by opening a file to write and leaving it open. Is this method safe? Do you know of an alternative method using C? 回答1: The standard solution is to create a global mutex during application startup. The first time that the app is started, this will succeed. On subsequent attempts, it will fail, and that is your clue to halt and fail to load the second instance. You create

open program once with multiple files as arguments from explorer

六眼飞鱼酱① 提交于 2019-12-02 02:12:49
问题 I have a program that works when, a file is opened with it using the right click menu in explorer. But if I select multiple files and then right click and open with my program then it opens multiple instances of my program, instead of just passing the multiple files as arguments to a single instance. The program is written in vb.net but is not a windows form, it is just a module, so I can to tick the Single instance option in the properties in Visual Studio. So how do I open multiple files

Making a singleton application across all users

你离开我真会死。 提交于 2019-12-02 00:53:56
I'm trying to create an application which only allows a single instance across all Windows users. I'm currently doing it by opening a file to write and leaving it open. Is this method safe? Do you know of an alternative method using C? The standard solution is to create a global mutex during application startup. The first time that the app is started, this will succeed. On subsequent attempts, it will fail, and that is your clue to halt and fail to load the second instance. You create mutexes in Windows by calling the CreateMutex function . As the linked documentation indicates, prefixing the

open program once with multiple files as arguments from explorer

a 夏天 提交于 2019-12-01 20:55:53
I have a program that works when, a file is opened with it using the right click menu in explorer. But if I select multiple files and then right click and open with my program then it opens multiple instances of my program, instead of just passing the multiple files as arguments to a single instance. The program is written in vb.net but is not a windows form, it is just a module, so I can to tick the Single instance option in the properties in Visual Studio. So how do I open multiple files from explorer context menu in a single instance. No happy answers here, Windows Explorer doesn't provide