473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

stop multi instantes of program on one machine

Hi,

I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?

Thank you in advance for your help.
Jun 27 '08 #1
8 952
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,

I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?

Thank you in advance for your help.
There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.

Thanks,

Seth Rowe [MVP]
Jun 27 '08 #2

Seth

I believe this option was introduced in the 2005 version of VS ( i use 2008
now so can`t check that for sure )

if the TS is using a version < 2005 of VS he migh investigate the diverse
postings that use a Mutex

see for instance http://www.freevbcode.com/ShowCode.Asp?ID=5845
or my own version :-) wich is Terminal server proof
http://www.freevbcode.com/ShowCode.asp?ID=7654

HTH

Michel

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:29**********************************@x35g2000 hsb.googlegroups.com...
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
>Hi,

I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?

Thank you in advance for your help.

There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.

Thanks,

Seth Rowe [MVP]

Jun 27 '08 #3
On May 1, 9:30*am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,
I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?
Thank you in advance for your help.

There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.

Thanks,

Seth Rowe [MVP]
Seth,

That worked great. Thank you for your help
Jun 27 '08 #4
On May 1, 6:05 pm, id10t error <tubbz...@gmail.comwrote:
On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,
I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?
Thank you in advance for your help.
There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.
Thanks,
Seth Rowe [MVP]

Seth,

That worked great. Thank you for your help
Hi,
You can also check this out:
http://www.bobpowell.net/singleinstance.htm

or it can be done by querying application's current entity using
process class.

Thanks,

Onur
Jun 27 '08 #5
On 2008-05-01, kimiraikkonen <ki*************@gmail.comwrote:
On May 1, 6:05 pm, id10t error <tubbz...@gmail.comwrote:
>On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,
I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?
Thank you in advance for your help.
There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.
Thanks,
Seth Rowe [MVP]

Seth,

That worked great. Thank you for your help

Hi,
You can also check this out:
http://www.bobpowell.net/singleinstance.htm

or it can be done by querying application's current entity using
process class.

Thanks,

Onur
Another process name method... I always try to warn people off of this
method. It's just as easy to use a mutex and less dangerous. I know
the chance is small - but process names are not necessarily unique.
There is nothing stopping me from creating an application names
notepad.exe. If I were to use this method, then if the user starts the
real notepad, they can't start mine. I know that's extreme and
contrived - but, it isn't an impossible situation. Using a named mutex,
is generally a safer way to go.

--
Tom Shelton
Jun 27 '08 #6
On May 1, 7:01 pm, Tom Shelton
<tom_shel...@YOUKNOWTHEDRILLcomcast.netwrote:
On 2008-05-01, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On May 1, 6:05 pm, id10t error <tubbz...@gmail.comwrote:
On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,
I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already running
and not let them open it?
Thank you in advance for your help.
There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.
Thanks,
Seth Rowe [MVP]
Seth,
That worked great. Thank you for your help
Hi,
You can also check this out:
http://www.bobpowell.net/singleinstance.htm
or it can be done by querying application's current entity using
process class.
Thanks,
Onur

Another process name method... I always try to warn people off of this
method. It's just as easy to use a mutex and less dangerous. I know
the chance is small - but process names are not necessarily unique.
There is nothing stopping me from creating an application names
notepad.exe. If I were to use this method, then if the user starts the
real notepad, they can't start mine. I know that's extreme and
contrived - but, it isn't an impossible situation. Using a named mutex,
is generally a safer way to go.

--
Tom Shelton
Tom,
That's a good point, blocking an application by its name can cause
conflicts with the applications that have the same name, though it's
not common but possible as you stated.

Also another point might be, the user can start application by
changing application name before launch, so this way(GetProcessByname)
won't avoid your application to be executed more than once by a
clever user.

Thanks :)

Onur
Jun 27 '08 #7

"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:70**********************************@a23g2000 hsc.googlegroups.com...
On May 1, 7:01 pm, Tom Shelton
<tom_shel...@YOUKNOWTHEDRILLcomcast.netwrote:
>On 2008-05-01, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On May 1, 6:05 pm, id10t error <tubbz...@gmail.comwrote:
On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:
Hi,
I am sorry that my description is not better but it is hard to
think
of one for this problem. I have a program on the user computer and
I
need to only let them have one instants of this program open at
one
time. Is there a way to check to see if the program in already
running
and not let them open it?
Thank you in advance for your help.
There is a setting on the application's property pages called
"Single
Instance Application" or something similar - you should check that
option.
Thanks,
Seth Rowe [MVP]
>Seth,
>That worked great. Thank you for your help
Hi,
You can also check this out:
http://www.bobpowell.net/singleinstance.htm
or it can be done by querying application's current entity using
process class.
Thanks,
Onur

Another process name method... I always try to warn people off of this
method. It's just as easy to use a mutex and less dangerous. I know
the chance is small - but process names are not necessarily unique.
There is nothing stopping me from creating an application names
notepad.exe. If I were to use this method, then if the user starts the
real notepad, they can't start mine. I know that's extreme and
contrived - but, it isn't an impossible situation. Using a named mutex,
is generally a safer way to go.

--
Tom Shelton

Tom,
That's a good point, blocking an application by its name can cause
conflicts with the applications that have the same name, though it's
not common but possible as you stated.

Also another point might be, the user can start application by
changing application name before launch, so this way(GetProcessByname)
won't avoid your application to be executed more than once by a
clever user.

Thanks :)

Onur


Onur

If you would have clicked on my example ( the second link that is
Terminal server capable ) you would have seen that there is a simple
solution for that problem
instead of creating a mutex by name you create one by application GUID
HTH

Michel
Jun 27 '08 #8
Here we have one catch. Checking the Checkbox of single instance would work
fine for Single login machine. In case of machines (OS) where multiple user
can login at same time, this won't work. This checkbox setting works for
that that login. If other user login on same machine, then there is
possiblity that second instance can start of same application.

Thanks,
Mayur H Chauhan

"Tom Shelton" <to*********@YOUKNOWTHEDRILLcomcast.netwrote in message
news:eK**************@TK2MSFTNGP04.phx.gbl...
On 2008-05-01, kimiraikkonen <ki*************@gmail.comwrote:
>On May 1, 6:05 pm, id10t error <tubbz...@gmail.comwrote:
>>On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:

On May 1, 9:17 am, id10t error <tubbz...@gmail.comwrote:

Hi,

I am sorry that my description is not better but it is hard to think
of one for this problem. I have a program on the user computer and I
need to only let them have one instants of this program open at one
time. Is there a way to check to see if the program in already
running
and not let them open it?

Thank you in advance for your help.

There is a setting on the application's property pages called "Single
Instance Application" or something similar - you should check that
option.

Thanks,

Seth Rowe [MVP]

Seth,

That worked great. Thank you for your help

Hi,
You can also check this out:
http://www.bobpowell.net/singleinstance.htm

or it can be done by querying application's current entity using
process class.

Thanks,

Onur

Another process name method... I always try to warn people off of this
method. It's just as easy to use a mutex and less dangerous. I know
the chance is small - but process names are not necessarily unique.
There is nothing stopping me from creating an application names
notepad.exe. If I were to use this method, then if the user starts the
real notepad, they can't start mine. I know that's extreme and
contrived - but, it isn't an impossible situation. Using a named mutex,
is generally a safer way to go.

--
Tom Shelton

Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Garry Hodgson | last post by:
a colleague of mine has seen an odd problem in some code of ours. we initially noticed it on webware, but in distilling a test case it seems to be strictly a python issue. in the real system, it...
8
by: Eric Osman | last post by:
My javascript program has reason to want to stop. For example, function A has 5 lines, the second of which calls function B, which has 5 lines, the first of which calls function C. But...
3
by: Amit Dedhia | last post by:
Hi I am developing a Dot net application (involving image processing) on a uni processor. It works well on my machine. I then take all my code on a multi processor, build and run the application...
1
by: Carl Waldbieser | last post by:
I have been considering using Python and the Reportlab library for generating PDF reports for the back-end of a web based application. The application runs most of its background tasks on a...
5
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone...
2
by: Chris Dunaway | last post by:
I need to be able to start and stop a service on another computer on the network. But I cannot connect to the other computer using my standard user credentials. I have a separate login for that...
4
by: gdarian216 | last post by:
I am doing a multi file program and I got it to work correctly in a single file but when I split it up it isn't working properly. I keep getting errors when i compile. Can anyone help me figure out...
1
by: =?Utf-8?B?S2Vubnk=?= | last post by:
I have one bat file that contains a command to startup Java Program. Then, I would like to create a cluster job to call the bat file. In case of one computer is down, another computer can also call...
31
by: zdenko | last post by:
I have a multi user database and users were created by user level security wizzard - as I mentioned in message before. Everything works fine for those users, but now I have another problem. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.