Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions BrowserSelect/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public partial class Form1 : Form
public Form1()
{
InitializeComponent();
MaximizeBox = false;
}

public void updateBrowsers()
Expand Down Expand Up @@ -253,7 +254,12 @@ public static void open_url(Browser b, bool incognito = false)
}
else
{
Process.Start(b.exec, Program.Args2Str(args));
ProcessStartInfo startInfo = new ProcessStartInfo(b.exec);
// Clicking MS Edge takes more than 4 seconds to load, even with an existing window
// Disabling UseShellExecute to create the process directly from the browser executable file
startInfo.UseShellExecute = false;
startInfo.Arguments = Program.Args2Str(args);
Process.Start(startInfo);
}
Application.Exit();
}
Expand Down Expand Up @@ -284,7 +290,15 @@ private void center_me()
var top = wa.Height / 2 + wa.Top - Height / 2;

this.Location = new Point(left, top);
this.Activate();


// Borrowed from https://stackoverflow.com/a/5853542
// Get the window to the front
this.TopMost = true;
this.TopMost = false;

// "Steal" the focus
this.Activate();
}

private void btn_help_Click(object sender, EventArgs e)
Expand Down