WM_GETICON not working (Windows)

后端 未结 2 2015
遇见更好的自我
遇见更好的自我 2021-01-27 21:28

If I don\'t use WM_SETICON first to set the icon then WM_GETICON is always returning 0. This is weird. Please help.

This is my code, can copy paste into scratchpad and r

2条回答
  •  青春惊慌失措
    2021-01-27 21:44

    Well, there is a surprisingly easy (and cross-platform) way to retrieve the default icon of Firefox.

    var foxexe = FileUtils.getFile("XREExeF", []);
    var iconurl = "moz-icon:" + Services.io.newFileURI(foxexe).spec;
    

    You can treat iconurl the same way as any other image-pointing url. The default size is 16x16, append ?size=32 to get a bigger icon. It seems that these two values are the only supported on Windows. This might not be the case for other OSes.

提交回复
热议问题