Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-18-2004, 03:15 PM
Junior Member
 
Join Date: Feb 2003
Posts: 3
Default EXE as Singleton?

Are there any options to compile the EXE as a singleton? I'd like to make it so that our "projector" can only run once.
Reply With Quote
  #2 (permalink)  
Old 08-18-2004, 05:00 PM
Member
 
Join Date: Jan 2003
Posts: 54
Send a message via MSN to swfbaz Send a message via Yahoo to swfbaz
Default Re:EXE as Singleton?

So simple.... You will also have to manipulate Operating System Registry.

When your app runs for the first time, create a key in HKEY_LOCAL_MACHINE object, having your application name... Or if you know how to work with Registry then put the key of your application somewhere else in the registry. Make your application to read the registry using RegKey Object... and if it is found, shut your application down or prompt an expiration message or do wot ever you want.

i hope it will help you out...



__________________
SWFBaz Preview [October 2006]
http://www.SWFBaz.com
Reply With Quote
  #3 (permalink)  
Old 08-19-2004, 01:51 AM
Junior Member
 
Join Date: Feb 2003
Posts: 12
Default Re:EXE as Singleton?

from documentation
Quote:
You can write some codes in the Initialize script to prevent another instance of the same application from running:
Code:
//Finds windows with the same name as this window
var wnds = Window.getWindowsByName(your window name);

//Checks if there is another window has the same name as this one
var w = getMainWnd();
var has = false;

for (i = 0; i < wnds.length(); i++)
{

if (wnds[i].handle != w.handle)
{
has = true;
break;
}

}

if (has)
{

wnds[i].bringToTop();
return false;

} 

return true;
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:50 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.