Click here to Skip to main content
15,911,496 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Friends,

I have opened a windows calculator on the click of a button on my web application but the moment i again click on the same button again, an another instance of the windows calculator opens again.

How can i ensure that only one instance should be opened at a time.

Thanks

Varun Sareen
Posted

1 solution

You'll need to see if the process is open before you launch it.

This example may help.
http://msdn.microsoft.com/en-us/library/ms682623.aspx[^]
 
Share this answer
 
Comments
Varun Sareen 11-Nov-11 20:41pm    
hey dear jack, the solution you gave me is unclear and not up to the mark :(
JackDingler 11-Nov-11 23:07pm    
Every process running has a name and an ID. That source code allows you to iterate through all of the running processes.

If one of the processes is 'calculator.exe', then don't launch another instance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900