Hi everyone
I've been working on developing a web browser in VB6 similar in capability to IE and I would like to set it as the default browser. I have been unsuccessful in finding any way to A) change the default browser to mine with the program itself [the way IE does if you tell it to check if it is the default] or B) change it manually via the registry or whatever might be the case. Any help you can provide would be greatly appreciated.
Thank you for your time!
-tom

Dani AI

Generated

Brief summary and practical path forward

As hinted, changing the HTTP handler in the registry used to be the quick way to make a VB browser the default, but modern Windows no longer allows silent “takeover” edits. For Windows Vista and later the supported approach is to register your app’s capabilities so it appears in Default Programs (then have the user choose it); older registry hacks only work reliably on legacy systems. (learn.microsoft.com)

Installer / registration checklist (what to write during install)

  • Register a ProgID and the file-type associations your browser supports (htm, html, etc.).
  • Add a Start-menu browser entry and a Capabilities subtree such as HKLM\SOFTWARE\Clients\StartMenuInternet\YourBrowser\Capabilities and list URLAssociations for http/https and FileAssociations for .htm/.html.
  • Add your Capabilities path to HKLM\SOFTWARE\RegisteredApplications so Windows lists your app in Default Programs.
  • After installing those keys call the shell notification (SHChangeNotify with SHCNE_ASSOCCHANGED) and direct the user to the Default Programs / Settings UI to pick your browser (Windows will not let third-party apps silently flip protected user choices). (learn.microsoft.com)

VB6-specific tips and common pitfalls

  • Make the installer write a quoted command line that includes the URL placeholder (so the OS can pass the clicked link) and make your EXE parse switches and forward them to the WebBrowser control — relying on undocumented browser switches is fragile.
  • Watch 32-bit vs 64-bit installer behavior: registry writes from a 32-bit installer on x64 get redirected under Wow6432Node unless you explicitly use the correct registry view. Test both installer bitnesses.
  • If you need legacy short names there is a Windows API to get the 8.3 form, but quoting the full path and using the %1 placeholder is the safer approach. (gist.github.com)

Testing and cautions

Test on clean VMs for every Windows target (XP / 7 / 10 / 11) and on both per-user and machine installs. For modern Windows always invite the user to make your browser the default rather than trying to force it — that is the supported, reliable, and least‑surprising method. (pcworld.com)

Recommended Answers

All 3 Replies

;)

HKEY_CLASSES_ROOT\http\shell\open\command

In VB or VBS, This is real easy to do.

thanks for the reply. If you (or anyone else, I suppose) wouldn't mind answering them, I have a few more questions now that I know that. I see the value on my comp for IE is:

"C:\PROGRA~1\INTERN~1\IEXPLO~1.EXE" -nohome

If my browser is "C:\Program Files\BrowserProg\Browser.exe" is this right:
"C:\PROGRA~1\BROWSE~1\BROWSER.EXE" -nohome

Also, does "-nohome" mean there is no homepage set, and if so, what would it look like set?

Thanks you for your time :D

It depends on the operating system, in regards to your path. If you are using NTFS, chances are that they whole entire Path is acceptable. If you are using FAT or something along those lines, then the chances are good that you'll need to ~ them. I suggest manually trying it in the registry, with one way, and then trying to see if it loads correctly, if not, try the other way.

As For -nohome, there has been a ton of different explanations, but it would be a blank white page. some people claim nohome is just about:blank, otherwise claim it's...... a little something more on the dark side.

I'm not 100% sure that -nohome is going to work with your program, even if you are using VB's web browser control. Because you are not passing paramaters (-nohome) to the object (the browser control), you are passing it to YOUR EXE.

So, You'd have to check something about passing parameters to your program, and then passing those to your control. Basically, something a little more to the point would be:

browser1.navigate "about:blank"

use that in your form load, or, whenver the browser is supposed to show. That will do essentially the same thing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.