Instead of reading the web browser's icon from the exe itself I took the approach of preparing in advance the icons of commonly used browser and select which one to use after determining what is current default browser.
Anyone knows what is the tried and tested method to include alpha blended images in an rc compiled with brc? Is changing the resource compiler the only way to go?
function WebBrowserIcon()
// code based on <!-- m --><a class="postlink" href="https://stackoverflow.com/questions/13621467/how-to-find-default-web-browser-using-c">https://stackoverflow.com/questions/136 ... er-using-c</a><!-- m -->
local oReg, cProgId, cPath := "", nPos, cBrowser := "Unknown browser", cCom, cIcon := ""
// determine prog id of default browser
oReg := TReg32():New(HKEY_CURRENT_USER, "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" )
cProgId := oReg:Get("ProgId")
oReg:Close()
do case
case cProgId == "IE.HTTP"
cBrowser := "Internet Explorer"
cIcon := "ie.bmp"
case cProgId == "FirefoxURL"
cBrowser := "Firefox"
cIcon := "firefox.bmp"
case cProgId == "ChromeHTML"
cBrowser := "Chrome"
cIcon := "chrome.bmp"
case cProgId == "OperaStable"
cBrowser := "Opera"
cIcon := "opera.bmp"
case cProgId == "SafariHTML"
cBrowser := "Safari"
case cProgId == "AppXq0fevzme2pys62n3e0fbqa7peapykr8v"
cBrowser := "Microsoft Edge"
cIcon := "edge.bmp"
endcase
if !empty(cIcon)
cIcon := ud_bmpDir() + "\" +cIcon
endif
// use the progid to determine path to exe
if !empty(cProgId)
oReg := TReg32():New(HKEY_CLASSES_ROOT, cProgId + "\shell\open\command" )
cPath := oReg:Get()
oReg:Close()
if (nPos := at(".exe", cPath)) > 0
cPath := left(cPath, nPos+5)
endif
endif
if !empty(cPath)
*cCom := 'iconsext.exe /save '+cPath+' "'+ud_bmpDir()+'" -icons'
*waitrun(cCom, SW_HIDE)
endif
return cIcon