How to make your browser the default

Use this board to post your code snippets - tips and tricks
21 posts Page 1 of 3
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Just showing you how to make your own webbrowser the default one
Code: Select all
Dim Key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\Clients\StartmenuInternet", True) 'Creates or opens the registry key for the default browser with write access
Key.SetValue("", "BROWSER PATH") 'The path of your program
Key.Close() 'closes and flushes the key
Replace "BROWSER PATH" with the program that should be the default browser
Or:
Code: Select all
Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Software\Clients\StartmenuInternet", "", "BROWSER PATH")
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

I think this has already been posted here but it might of been a question, but good anyway cooll;
You're crazy!
I'm not crazy, my mother had me tested. ~Sheldon Cooper
User avatar
Zulf
Serious Programmer
Serious Programmer
Posts: 441
Joined: Fri Jun 11, 2010 7:46 am

This gives me an idea..To make a registry tool. :D
Image
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Agust1337 wrote:
I think this has already been posted here but it might of been a question, but good anyway cooll;
You're right, a question has been posted(same forum in uploading/downloading files) but I didn't figure out how to do it until now
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Thanks for the code, this one will be easier to find then the other one :)
But, how does the browser open the webpage after being opened as the default browser?.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

You can get the URL from command line arguments.
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

That would be like this
Code: Select all
Dim args as [string]() = environment.GetCommandLineArgs()
webbrowser1.navigate(args(0))
if its using multiple arguments you would need to change 0 to whatever
http://vagex.com/?ref=25000
User avatar
Skillful
Skillful Coders
Skillful Coders
Posts: 969
Joined: Tue Nov 16, 2010 10:07 am

Nice little piece of code MrAksel! Useful for me!
Instead of LOL use this -
LSIBMHBIWFETALOL

Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

What would be new is that if it would check if it was the default browser like Chrome, FireFox, IE etc... do
You're crazy!
I'm not crazy, my mother had me tested. ~Sheldon Cooper
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Agust1337 wrote:
What would be new is that if it would check if it was the default browser like Chrome, FireFox, IE etc... do
Wouldn't be that hard to create, just read the reg. key
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
21 posts Page 1 of 3
Return to “Quick Snips”