Click here to Skip to main content
12,950,084 members (42,421 online)
Click here to Skip to main content
Add your own
alternative version


24 bookmarked
Posted 17 Apr 2002

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. :-)

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

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


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)

You may also be interested in...


Comments and Discussions

QuestionThanks, bigZidane. Pin
TigerRex1-Nov-14 22:13
memberTigerRex1-Nov-14 22:13 
GeneralMy vote of 1 Pin
mercede15-Oct-09 23:20
membermercede15-Oct-09 23:20 
GeneralWhatta bunch Pin
GoddFadda3-Jan-03 18:04
memberGoddFadda3-Jan-03 18:04 
GeneralWhatever Pin
Anonymous5-Sep-02 23:51
sussAnonymous5-Sep-02 23:51 
Generalwinxp, multiple user Pin
Anonymous19-Apr-02 9:21
memberAnonymous19-Apr-02 9:21 
GeneralRe: winxp, multiple user Pin
Michael Dunn19-Apr-02 11:59
subeditorMichael Dunn19-Apr-02 11:59 
GeneralRe: winxp, multiple user Pin
bigZidane19-Apr-02 17:21
memberbigZidane19-Apr-02 17:21 
GeneralWhat's the point with UUIDGEN.EXE Pin
Ernest Laurentin18-Apr-02 4:44
memberErnest Laurentin18-Apr-02 4:44 
GeneralRe: What's the point with UUIDGEN.EXE Pin
Anonymous18-Apr-02 23:35
memberAnonymous18-Apr-02 23:35 
GeneralRe: What's the point with UUIDGEN.EXE Pin
thenickname10-Apr-05 11:13
sussthenickname10-Apr-05 11:13 
GeneralBug Pin
Tim Smith18-Apr-02 4:23
memberTim Smith18-Apr-02 4:23 
GeneralRe: Bug Pin
Anonymous18-Apr-02 5:55
memberAnonymous18-Apr-02 5:55 
GeneralHm... Pin
George17-Apr-02 22:28
memberGeorge17-Apr-02 22:28 
GeneralRe: Hm... Pin
bigZidane17-Apr-02 22:43
memberbigZidane17-Apr-02 22:43 
GeneralRe: Hm... Pin
George17-Apr-02 22:52
memberGeorge17-Apr-02 22:52 
GeneralRe: Hm... Pin
bigZidane17-Apr-02 22:58
memberbigZidane17-Apr-02 22:58 
GeneralRe: Hm... Pin
Jim A. Johnson18-Apr-02 4:17
memberJim A. Johnson18-Apr-02 4:17 
GeneralRe: Hm... Pin
Anonymous18-Apr-02 5:58
memberAnonymous18-Apr-02 5:58 
GeneralRe: Hm... Pin
venkpai20-Oct-05 12:47
membervenkpai20-Oct-05 12:47 
GeneralRe: Hm... Pin
mercede15-Oct-09 23:21
membermercede15-Oct-09 23:21 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 18 Apr 2002
Article Copyright 2002 by bigZidane
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid