<p><a href="https://stackoverflow.com/questions/26305322/shellexecute-fails-for-local-html-or-file-urls" rel="nofollow">https://stackoverflow.com/questions/26305322/shellexecute-fails-for-local-html-or-file-urls</a> pretty much describes our problem: <code>ShellExecute(..., "open", ...)</code> does not handle URL anchors properly.</p>
<p>I just tested dropping the Windows specific code for opening a browser and just used the non-Windows code and it's working perfectly fine for all cases I tested (Pref dialog links, About dialog link, Help menu item links, Build->Run command with "builtin") and all worked.<br>
So I'm wondering to just use the non-Windows code.<br>
The only "problem" is the browser default. We set it to "firefox" which usually works on Linux but not on Windows (except the user adds firefox.exe to $PATH).<br>
Fortunately, we can read the system default browser with GIO:</p>
<div class="highlight highlight-source-c"><pre>           GAppInfo *ai1 = g_app_info_get_default_for_uri_scheme(<span class="pl-s"><span class="pl-pds">"</span>http<span class="pl-pds">"</span></span>);
                <span class="pl-en">g_app_info_get_commandline</span>(ai1)</pre></div>
<p>this worked on my Windows box and the returned command could be opened as is.</p>
<p>So, a possible solution could be to drop the Windows specific code for opening the browser and use GIO to try to read the default browser if it is not set (and leave it unset if unset).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2405?email_source=notifications&email_token=AAIOWJ7C2ZYGHFNRYD5HPYTQV3VF3A5CNFSM4JRYDCI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFK3RSQ#issuecomment-559265994">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7QYH4TL4AV72LX6PDQV3VF3ANCNFSM4JRYDCIQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJYVJISTKAFN427DRMTQV3VF3A5CNFSM4JRYDCI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFK3RSQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2405?email_source=notifications\u0026email_token=AAIOWJ7C2ZYGHFNRYD5HPYTQV3VF3A5CNFSM4JRYDCI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFK3RSQ#issuecomment-559265994",
"url": "https://github.com/geany/geany/issues/2405?email_source=notifications\u0026email_token=AAIOWJ7C2ZYGHFNRYD5HPYTQV3VF3A5CNFSM4JRYDCI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFK3RSQ#issuecomment-559265994",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>