Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:12:20+00:00 2026-06-04T11:12:20+00:00

I have a link on my app UI that launches a URL using System.Diagnostics.Process.Start()

  • 0

I have a link on my app UI that launches a URL using System.Diagnostics.Process.Start(). If the user clicks the link several times, it opens several tabs.

Is there a way, maybe a command-line option, to still use the default web browser, but have it just reopen the same tab if the URL is already open? It would be OK if it doesn’t work with every possible browser out there, but nice if it at least works with IE, Firefox and Chrome.

I doubt it, but since I didn’t see any other questions/answers on this topic, I figured I’d ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:12:22+00:00Added an answer on June 4, 2026 at 11:12 am

    This is somewhat of a workaround but it might get you started. I have used the System.Diagnostics.Process.ProcessId.
    As an example I have used IE, I will explain later why I did this. The code is just “quick and dirty” but I just made it as proof of concept.

    I have created a basic WinForm app with one button that will open google in IE, if it has already been opened by the application it will not be opened again.

    I added the System.Diagnostics reference.

        public int ProcessID;
        public Form1()
        {
            InitializeComponent();
        }
        private void MyButton_Click(object sender, EventArgs e)
        {
            if (ProcessID == null)
            {
                StartIE();
            }
            else
            {
                if (!ProcessIsRunning())
                {
                    StartIE();
                }
            }
        }
        private bool ProcessIsRunning()
        {
            bool ProcessRunning = false;
            foreach (Process p in Process.GetProcesses())
            {
                try
                {
                    if (p.Id == ProcessID)
                    {
                        ProcessRunning = true;
                    }
                }
                catch { }
            }
            return ProcessRunning;
        }
        private void StartIE()
        {
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo.FileName = "iexplore.exe";
            proc.StartInfo.Arguments = "http://www.google.be";
            proc.Start();
            ProcessID = proc.Id;
        }
    

    This does not completely do what you requested but it might be a good start. There are a few reasons why I did it this way and what possible options are..

    • If you would use the url as the Filename, it would indeed open up the webpage in the default browser, it would however not return a processID. This is why the snippet shows usage of IE. (If you would use this option, you could use the System.IO.File.Exists to make sure the desired browser is installed)
    • If you would like to use this option, you can query the registry to pick up what te default browser is, if you have that you could launch that from the value obtained from the registry. If you then change the process.startinfo.filename to this value, then you will launch the default browser but you will still obtain a processId so this might be the way forward. You can check how to do this over here: http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/b200903e-ce69-4bd4-a436-3e20a7632dc4
    • Showing the internet window if it would already be opened, can be done by using the SetForegroundWindow property. As this is already documented in this article, I did not add it in this snippet.

    I hope this helps to get you on your way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an iOS app that requires a user to link his/her Dropbox
I have a simple GAE app that includes a login/logout link. This app is
am using the application in this link http://www.jeasyui.com/tutorial/app/crud2.php .I have added one more column
I have an app that is displaying a webpage using a WebView control. I
I have a Rails 3 app that uses a remote/AJAX link to update a
I have an app that has posts, tags, and a tag_ref link table. I
I have an app that displays products for a client. The user has the
I have a link on my mobile app (created with Sencha Touch 2) with
I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have a link on a page that pops up a new window, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.