|
Home > Archive > microsoft.public.cert.exam.mcsd > October 2002 > Restricting running exe second time
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Restricting running exe second time
|
|
|
| Hi All,
I am running AAA.exe on the server it is running fine,
here is the question If I click AAA.exe again It should
not run the second instance how to restrict it.
Thank you,
Chary
| |
|
| "Chary" <rchary@fdic.gov> wrote in message
news:9a6a01c2793c$9f4541b0$35e
f2ecf@TKMSFTNGXA11...
> I am running AAA.exe on the server it is running fine,
> here is the question If I click AAA.exe again It should
> not run the second instance how to restrict it.
I use a semaphore. The application creates & opens it on startup, and if it
is already held by another instance, I shut down. I do some additional stuff
first to find and activate the running instance and pop up a warning if the
two instances are different versions (mostly to help our own testing of
various updates).
Simpler methods like using FindWindow() are less reliable, particularly when
2 instances are launched at nearly the same time. It's actually not too hard
to accidentally do this when launching via clicks with Explorer and
contending with the evil 'Why don't you rename this file now' feature.
| |
|
| "Chary" <rchary@fdic.gov> wrote in message
news:9a6a01c2793c$9f4541b0$35e
f2ecf@TKMSFTNGXA11...
> Hi All,
>
> I am running AAA.exe on the server it is running fine,
> here is the question If I click AAA.exe again It should
> not run the second instance how to restrict it.
Check also http://support.microsoft.com/defaul...B;EN-US;Q243953
Alex
|
|
|
|
|