Windows 10 custom HTTP URL Redirector

Caiaphas McCain 1 Reputation point
2022-11-04T12:43:02.357+00:00

I wrote a shell app that accepts URLs as arguments and forwards them to an appropriate program.

app https://youtu.be/mrX0LTNhAgM

^This opens FreeTube to that video address.

app https://www.bing.com

^This is redirected to a web browser

My app works when I give it addresses as arguments in the shell, but not when links in non-browser programs are clicked (like Signal, Discord, or IRC clients),

https://learn.microsoft.com/en-us/windows/win32/shell/default-programs
^I've followed this guide and carefully set the appropriate value in the registry hive, but my app is not showing in the default apps list to set as the new default browser.
What specifically will add a program to the browsers list?

I also tried calling SHChangeNotify with the SHCNE_ASSOCCHANGED flag from within the app, but no notification or change occurred.
https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shchangenotify

Here are the registry changes I've made:

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"XenDirect_C"="Software\Gambit_Software\XenDirect_C\Capabilities"

[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software]
[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C]
[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\Capabilities]
"ApplicationName"="XenDirect_C"
"ApplicationDescription"="Allows Link Redirecting"

[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\Capabilities\Startmenu]
"StartmenuInternet"="\"%userprofile%\DEVOPS\#Current\XenDirect_C\x64\Release\XenDirect_C.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\Capabilities\UrlAssociations]
"http"="XenDirect_C"
"https"="XenDirect_C"

[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Gambit_Software\XenDirect_C\shell\open\command]
@="%userprofile%\DEVOPS\#Current\XenDirect_C\x64\Release\XenDirect_C.exe"

Windows development | Windows API - Win32
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.