Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AbrahamR, AndrewAMD, ozgur), 763 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Open and openning programs? #400996
05/10/12 21:35
05/10/12 21:35
Joined: Aug 2011
Posts: 58
Colombia/Bogotá
W
wdakfenixx Offline OP
Junior Member
wdakfenixx  Offline OP
Junior Member
W

Joined: Aug 2011
Posts: 58
Colombia/Bogotá
Hi, I just want to ask two things, Is it posible to detect if the same program is already running on the machine and if is possible to execute another program from the one you write on lite-C


CAUTION :The content above could blow your mind
Re: Open and openning programs? [Re: wdakfenixx] #400997
05/10/12 21:46
05/10/12 21:46
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
an idea would be to write a variable into the registry, and set it to 1, 2..3..etc just the count of how many times a program is opened at the same time, and lower the value if one of the programs closes.

Now you can readout the registry, and ask if this value is 1 or higher.


executing other porgrams, calling a webpage or documents.. are done by using exec


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Open and openning programs? [Re: Espér] #400999
05/10/12 22:02
05/10/12 22:02
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You should have a look at

http://www.conitec.net/beta/sys_active.htm

and

http://www.conitec.net/beta/ain-exec.htm

Espers suggestion concerning the registry is dangerous in terms of concurrency. You cannot atomically read and write a registry value.


Always learn from history, to be sure you make the same mistakes again...
Re: Open and openning programs? [Re: Uhrwerk] #401005
05/10/12 23:22
05/10/12 23:22
Joined: Aug 2003
Posts: 902
Van Buren, Ar
Gordon Offline
User
Gordon  Offline
User

Joined: Aug 2003
Posts: 902
Van Buren, Ar
If you do all the registry access in main before you load a level or do a wait then it should be ok. However you want fully locked access then just create a mutex and do a read modify write operation there then test the value after closing the mutex. The only way that an unprotected read modify write operation would fail is if you got a windows task switch in the middle AND your doing the same operation in another program at the same time. If it is limited to program start and program end then the chance of failure is minimal as it is very difficult to start or end programs at the same time.


Our new web site:Westmarch Studios
Re: Open and openning programs? [Re: Gordon] #401007
05/10/12 23:24
05/10/12 23:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
And if you are talking about a server/ client application, try to use session_open and session_connect instead of the command line options.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Open and openning programs? [Re: Superku] #401016
05/11/12 06:35
05/11/12 06:35
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
or a stupid solution to create a file on startup and delete it on close. so you can check it with file_exists. the problem if it is not deleted because of an unhandled crash.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Open and openning programs? [Re: sivan] #401111
05/13/12 20:32
05/13/12 20:32
Joined: Aug 2011
Posts: 58
Colombia/Bogotá
W
wdakfenixx Offline OP
Junior Member
wdakfenixx  Offline OP
Junior Member
W

Joined: Aug 2011
Posts: 58
Colombia/Bogotá
thank you, it has been very useful


CAUTION :The content above could blow your mind

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1