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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,822 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,450 questions
C++
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.
3,566 questions
{count} votes