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 -->


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;


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


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


About the Author

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

Comments and Discussions

QuestionThanks, bigZidane. PinmemberTigerRex1-Nov-14 23:13 
GeneralMy vote of 1 Pinmembermercede16-Oct-09 0:20 
GeneralWhatta bunch PinmemberGoddFadda3-Jan-03 19:04 
GeneralWhatever PinsussAnonymous6-Sep-02 0:51 
Generalwinxp, multiple user PinmemberAnonymous19-Apr-02 10:21 
GeneralRe: winxp, multiple user PinsubeditorMichael Dunn19-Apr-02 12:59 
GeneralRe: winxp, multiple user PinmemberbigZidane19-Apr-02 18:21 
GeneralWhat's the point with UUIDGEN.EXE PinmemberErnest Laurentin18-Apr-02 5:44 
GeneralRe: What's the point with UUIDGEN.EXE PinmemberAnonymous19-Apr-02 0:35 
GeneralRe: What's the point with UUIDGEN.EXE Pinsussthenickname10-Apr-05 12:13 
GeneralBug PinmemberTim Smith18-Apr-02 5:23 
GeneralRe: Bug PinmemberAnonymous18-Apr-02 6:55 
GeneralHm... PinmemberGeorge17-Apr-02 23:28 
GeneralRe: Hm... PinmemberbigZidane17-Apr-02 23:43 
GeneralRe: Hm... PinmemberGeorge17-Apr-02 23:52 
GeneralRe: Hm... PinmemberbigZidane17-Apr-02 23:58 
GeneralRe: Hm... PinmemberJim A. Johnson18-Apr-02 5:17 
GeneralRe: Hm... PinmemberAnonymous18-Apr-02 6:58 
GeneralRe: Hm... Pinmembervenkpai20-Oct-05 13:47 
GeneralRe: Hm... Pinmembermercede16-Oct-09 0: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 | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 18 Apr 2002
Article Copyright 2002 by bigZidane
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid