The "different application" is a desktop app or a web app. How do you launch the browser ?
If this is a desktop app you likely use Process.Start and so you could check if the returned process is still running and block launching a second instance.
If this is a web site, you could direct a link to a named windows
https://www.w3schools.com/tags/att_a_target.asp to reuse the same tab/window. It's unlikely you could block launching a second instance.
I have a web app that will launch from a different application, i want to avoid launching duplicate instances.
How to i check if the same website is already opened in IE and i will close the second instance which is trying to open.
Thanks
sanj
Myself, I don't see how this is possible, since Web applications are stateless and are never running all the time to allow other users using Web applications to share the Web server resources, unlike a Windows desktop program that is running all of the time
until program terminates or is closed normally -- stateful -- and the process can be checked to see if it's already running.
If you find the post has answered your issue, then please mark post as 'answered'.
How do you launch your web app? Could you provide some detail?
Best Regards,
Billy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
17 Points
151 Posts
How to Identify Web app if already opened
Nov 07, 2017 08:45 PM|sreekanth.jonna|LINK
Hi,
I have a web app that will launch from a different application, i want to avoid launching duplicate instances.
How to i check if the same website is already opened in IE and i will close the second instance which is trying to open.
Thanks
sanj
All-Star
43240 Points
14958 Posts
Re: How to Identify Web app if already opened
Nov 07, 2017 11:00 PM|PatriceSc|LINK
Hi,
The "different application" is a desktop app or a web app. How do you launch the browser ?
If this is a desktop app you likely use Process.Start and so you could check if the returned process is still running and block launching a second instance.
If this is a web site, you could direct a link to a named windows https://www.w3schools.com/tags/att_a_target.asp to reuse the same tab/window. It's unlikely you could block launching a second instance.
Contributor
2821 Points
2569 Posts
Re: How to Identify Web app if already opened
Nov 07, 2017 11:07 PM|DA924|LINK
Myself, I don't see how this is possible, since Web applications are stateless and are never running all the time to allow other users using Web applications to share the Web server resources, unlike a Windows desktop program that is running all of the time until program terminates or is closed normally -- stateful -- and the process can be checked to see if it's already running.
Contributor
2230 Points
815 Posts
Re: How to Identify Web app if already opened
Nov 08, 2017 12:35 PM|Billy Liu|LINK
Hi Sanjay,
How do you launch your web app? Could you provide some detail?
Best Regards,
Billy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.