Click here to Skip to main content
Click here to Skip to main content

Single Instance Checker

, 17 Apr 2002
Rate this:
Please Sign up or sign in to vote.
Only 1 instance of your application can run in the same time
<!-- Download Links --> <!-- Add the rest of your HTML here -->

Introduction

If you want your application have just only instance is run in the same time, you only download and use it.

Step 1: Add file "LimitSingleInstance.h" to your project. This file is written by Microsoft. Smile | :)

Step 2: Run UUIDGEN.EXE to get ID. This tool is written by Micorosft Smile | :)

Step 3: Declare a variable

CLimitSingleInstance g_SingleInstanceObj(TEXT("{ID get from UUIDGEN}"));

for ex: CLimitSingleInstance g_SingleInstanceObj(TEXT("{addb6c1d-d98d-40f4-8041-0eb6b8bc884c}"));

Step 4: InitInstance()

Only add this line to check instance and make sure only 1 instance can run.

if (g_SingleInstanceObj.IsAnotherInstanceRunning()) return FALSE;

VERY and VERY SIMPLE.

I get this information and "LimitSingleInstance.h" from KnowledgeBase of Mirosoft site.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

bigZidane
Web Developer
Vietnam Vietnam
// -------------------------------- //
// Personal Information //
// -------------------------------- //
Yahoo ID : dothanhtrongnghia
AOL : trongnghia95
ICQ : 151917542
Cell Phone : (84)-(90)-(3329867)

Comments and Discussions

 
GeneralMy vote of 1 Pinmembermercede15-Oct-09 23:20 
GeneralWhatta bunch PinmemberGoddFadda3-Jan-03 18:04 
GeneralWhatever PinsussAnonymous5-Sep-02 23:51 
Generalwinxp, multiple user PinmemberAnonymous19-Apr-02 9:21 
GeneralRe: winxp, multiple user PinsubeditorMichael Dunn19-Apr-02 11:59 
GeneralRe: winxp, multiple user PinmemberbigZidane19-Apr-02 17:21 
GeneralWhat's the point with UUIDGEN.EXE PinmemberErnest Laurentin18-Apr-02 4:44 
GeneralRe: What's the point with UUIDGEN.EXE PinmemberAnonymous18-Apr-02 23:35 
GeneralRe: What's the point with UUIDGEN.EXE Pinsussthenickname10-Apr-05 11:13 
GeneralBug PinmemberTim Smith18-Apr-02 4:23 
GeneralRe: Bug PinmemberAnonymous18-Apr-02 5:55 
GeneralHm... PinmemberGeorge17-Apr-02 22:28 
GeneralRe: Hm... PinmemberbigZidane17-Apr-02 22:43 
GeneralRe: Hm... PinmemberGeorge17-Apr-02 22:52 
GeneralRe: Hm... PinmemberbigZidane17-Apr-02 22:58 
GeneralRe: Hm... PinmemberJim A. Johnson18-Apr-02 4:17 
GeneralRe: Hm... PinmemberAnonymous18-Apr-02 5:58 
GeneralRe: Hm... Pinmembervenkpai20-Oct-05 12:47 
GeneralRe: Hm... Pinmembermercede15-Oct-09 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 18 Apr 2002
Article Copyright 2002 by bigZidane
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid