 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Klaus Uttendorf Guest
|
Posted: Mon Jul 28, 2003 7:49 am Post subject: Prevent of double start under XP user concept |
|
|
Hello,
in Windows XP they have a new user concept, so that preventing double
start of a program by the normal 'CreateMutex(nil, true, modulname);'
don't work if you start from another user on the same computer.
Is there any solution known to prevent double start under XP?
Best regards
Klaus
|
|
| Back to top |
|
 |
Yahia El-Qasem Guest
|
Posted: Mon Jul 28, 2003 8:02 am Post subject: Re: Prevent of double start under XP user concept |
|
|
Just a guess :
Use shared memory ( via memory mapped file based on paging file ) - as along
as it hat the same name it shouldn't make a difference under which user the
app gets started... this way it should be possible to detect second start...
Yahia
"Klaus Uttendorf" <k.uttendorf (AT) epost (DOT) de> schrieb im Newsbeitrag
news:3F24D58C.5050701 (AT) epost (DOT) de...
| Quote: | Hello,
in Windows XP they have a new user concept, so that preventing double
start of a program by the normal 'CreateMutex(nil, true, modulname);'
don't work if you start from another user on the same computer.
Is there any solution known to prevent double start under XP?
Best regards
Klaus
|
|
|
| Back to top |
|
 |
Robert Meek Guest
|
Posted: Tue Jul 29, 2003 11:14 am Post subject: Re: Prevent of double start under XP user concept |
|
|
I hadn't realized that the regular Mutex method for restraining multiple
sessions of the same app from running were affected this way under XP...and
I'm assuming you mean if the current User logs off and another logs on
without doing a full re-start. if I'm wrong please let me know.
In any case, even if this is so and a second copy of the app begins to
run, they do so in a separate memory space and will not be affected by each
other, correct? The first copy started will simply be "put to sleep" as it
were when the new user logs on, right?
"Peter Below (TeamB)" <100113.1101 (AT) compuXXserve (DOT) com> wrote
| Quote: | In article <3F24D58C.5050701 (AT) epost (DOT) de>, Klaus Uttendorf wrote:
in Windows XP they have a new user concept, so that preventing double
start of a program by the normal 'CreateMutex(nil, true, modulname);'
don't work if you start from another user on the same computer.
Is there any solution known to prevent double start under XP?
You can use the mutex method, but you have to use a special naming
convention for the mutex name: use a name prefixed with 'Global'.
This creates the mutex in a namespace accessible to all users on the PC.
The problem is that this is platform-specific, using a '' in the name
is illegal in Win9x and NT 4. So if you need to support these older
platforms you have to test the platform your program is running on and
modify the name accordingly.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
|
| Back to top |
|
 |
Rick Carter Guest
|
Posted: Tue Jul 29, 2003 3:26 pm Post subject: Re: Prevent of double start under XP user concept |
|
|
Klaus Uttendorf <k.uttendorf (AT) epost (DOT) de> wrote:
| Quote: | in Windows XP they have a new user concept, so that preventing double
start of a program by the normal 'CreateMutex(nil, true, modulname);'
don't work if you start from another user on the same computer.
Is there any solution known to prevent double start under XP?
|
I'm not running XP, but would it work to use the FindWindow API
to search for a running instance of the program? Would that
solution meet your needs?
Rick Carter
[email]Rick.Carter (AT) cincww (DOT) rcc.org[/email]
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Tue Jul 29, 2003 7:27 pm Post subject: Re: Prevent of double start under XP user concept |
|
|
In article <3f26571c (AT) newsgroups (DOT) borland.com>, Robert Meek wrote:
| Quote: | I hadn't realized that the regular Mutex method for restraining multiple
sessions of the same app from running were affected this way under XP...and
I'm assuming you mean if the current User logs off and another logs on
without doing a full re-start. if I'm wrong please let me know.
|
XP uses something like Terminal services, several users can be logged in in
parallel, even though only one of them can be active at a time. I never used
XP myself but as far as i understand it one can switch between those user
sessions without performing a logoff/logon, only authentication is required,
like stopping a password-enabled screensaver.
| Quote: | In any case, even if this is so and a second copy of the app begins to
run, they do so in a separate memory space and will not be affected by each
other, correct?
|
Yes. But if you want to limit the app to one instance per *PC*, for licencing,
for example, the single instance check has to work across user sessions.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|