Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 8th Oct 2002 07:15
Is there anyway to see if there is already an instance of your program running? I'm thinking of writing some screensavers in the future, but windows has a tendency to keep loading the screensaver nonstop. It would be nice if i could make it where only 1 could run at a time.
1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
The One Ring
21
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 23rd Oct 2002 17:16
Yes, but you can't do it in DBP... In C++, try using CreateMutex, or maybe even FindWindow to determine if the application is already running. Go to http://msdn.microsoft.com and search for either of those commands for more information.

AMD Athlon 900 768MB DDR
ATI Radeon 64MB DDR All-In-Wonder 7500, ATI XPert 128 16MB
Sound Blaster Audigy Gamer w/FireWire Support
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 24th Oct 2002 01:36
You can do it in DBPro by checking the registry:

get registry("<program name and path>", "Running")

will return a value depending on whether your program is running or not.
The One Ring
21
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 24th Oct 2002 05:49
Yeah, I guess you could. Check for a specific flag in the registry when your app runs. If its not set, set it. Next app instances will see this flag and have it halt... good call Darthster

AMD Athlon 900 768MB DDR
ATI Radeon 64MB DDR All-In-Wonder 7500, ATI XPert 128 16MB
Sound Blaster Audigy Gamer w/FireWire Support
Lazzarus
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location:
Posted: 24th Oct 2002 12:46
How about 'app path'? Is that posibble? It would save adding thing to the DBP project.

Login to post a reply

Server time is: 2024-05-06 17:18:20
Your offset time is: 2024-05-06 17:18:20