Click here to Skip to main content
15,886,077 members
Articles / Desktop Programming / Win32

Using a Win32 Mutex to Figure Out if an Application Instance is the First One

Rate me:
Please Sign up or sign in to vote.
4.88/5 (13 votes)
21 Oct 2022MIT8 min read 9.3K   196   12  
This article shows how to use a win32 mutex during application startup to figure out if an application instance is the first one.
In some cases, an application needs to make sure it is the only instance running. This can be done using a mutex. There are a couple of details to consider in terms of applications running in a different logon session, and whether it is permissible to run multiple instances IF those instances are different copies on disk.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
Belgium Belgium
I am a former professional software developer (now a system admin) with an interest in everything that is about making hardware work. In the course of my work, I have programmed device drivers and services on Windows and linux.

I have written firmware for embedded devices in C and assembly language, and have designed and implemented real-time applications for testing of satellite payload equipment.

Generally, finding out how to interface hardware with software is my hobby and job.

Comments and Discussions