Board index » kylix » Building single-instance programs

Building single-instance programs


2005-01-06 05:47:15 PM
kylix1
Hey, gang. Happy New Year.
Would somebody be able to point me in the right direction for building
single-instance applications in Kylix? I need to force an app to run
with only a single instance. If a new instance is started, then it
should pass its command-line parameters to the running app. Googling
showed me a few Delphi ideas, but I couldn't find anything specific to
Kylix.
Ideas?
Cheers,
trane
--
/////////////////////////////////////////////////////////
// Trane Francks XXXX@XXXXX.COM Tokyo, Japan
// Practice random kindness and senseless acts of beauty.
 
 

Re:Building single-instance programs

Trane Francks wrote:
Quote
Hey, gang. Happy New Year.

Would somebody be able to point me in the right direction for building
single-instance applications in Kylix? I need to force an app to run
with only a single instance. If a new instance is started, then it
should pass its command-line parameters to the running app. Googling
showed me a few Delphi ideas, but I couldn't find anything specific to
Kylix.
Here (www.kylixforum.de/forum/viewtopic.php is a code I
posted some time ago to a German web forum which allows only one instance.
The commandline is not sent to the first instance.
An idea is to send the CmdLine which you have after these lines
if DirectoryExists(Format('/proc/%d', [pid])) then
begin
CmdLine := ReadProcFileToString(Format('%d/cmdline', [pid]));
to the other process (pid) by setting up a shared memory, a names pipe,
message queue.
The KDE code should contains such a code which meight be better than my
code and it looks like that it already has CmdLine sending code in it.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Building single-instance programs

Trane Francks schrieb:
Quote
Hey, gang. Happy New Year.

Would somebody be able to point me in the right direction for building
single-instance applications in Kylix? I need to force an app to run
with only a single instance. If a new instance is started, then it
should pass its command-line parameters to the running app. Googling
showed me a few Delphi ideas, but I couldn't find anything specific to
Kylix.

Hi Trane
This has been discussed before, see:
groups.google.com/groups&lr=&q=kylix+verify+if+application+running&btnG=Suche
 

{smallsort}

Re:Building single-instance programs

On 01/06/2005 07:24 PM +0900, Andreas Hausladen wrote:
Quote
Trane Francks wrote:

>Hey, gang. Happy New Year.
>
>Would somebody be able to point me in the right direction for building
>single-instance applications in Kylix? I need to force an app to run
Here (www.kylixforum.de/forum/viewtopic.php is a code I
posted some time ago to a German web forum which allows only one instance.
Thanks, as always, for your help, Andreas. This looks perfect.
trane
--
/////////////////////////////////////////////////////////
// Trane Francks XXXX@XXXXX.COM Tokyo, Japan
// Practice random kindness and senseless acts of beauty.