diff options
| author | Bitflash <btf01@proton.me> | 2026-08-03 15:34:41 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-03 15:34:41 -0300 |
| commit | f6e197573464268174edc6f8d3b0d5c2b194b1ed (patch) | |
| tree | 9a08eab5fd9133a5c8a6c5e36fb70371f4e6b439 | |
| parent | aba252206bf39ac81e6627354062c28fae05b0aa (diff) | |
gui: name the icon resource GLFW_ICON so the window actually wears it (#126)
The right icon has been in the exe the whole time. GLFW never found it.
GLFW registers its own window class and fills hIcon with
LoadImageW(module, L"GLFW_ICON", ...), falling back to IDI_APPLICATION
when that exact resource name is missing. Ours was named "bitflash", so
the lookup failed and every window this program has opened wore the
generic Windows icon -- in the title bar and in the taskbar -- while the
correct artwork sat unused a few kilobytes away.
One line, verified by looking at it: rebuilt, ran the window, and zoomed
in on both places the user pointed at. The title bar and the taskbar
button now show the green BF coin. Checked the shell path too, since it
resolves icons differently: ExtractAssociatedIcon on the new exe still
returns the coin, so renaming the resource did not cost the file icon in
Explorer.
| -rw-r--r-- | src/bitflash.rc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bitflash.rc b/src/bitflash.rc index 2654afa..a6703d2 100644 --- a/src/bitflash.rc +++ b/src/bitflash.rc | |||
| @@ -1,2 +1,8 @@ | |||
| 1 | // Bitflash application icon | 1 | // Bitflash application icon. |
| 2 | bitflash ICON "rc/bitcoin.ico" | 2 | // |
| 3 | // The name matters. GLFW registers its own window class and fills hIcon with | ||
| 4 | // LoadImageW(module, L"GLFW_ICON", ...), falling back to IDI_APPLICATION when | ||
| 5 | // that exact resource name is missing. It was named "bitflash" here, so every | ||
| 6 | // window this program has ever opened wore the generic Windows icon in its | ||
| 7 | // title bar and in the taskbar, while the correct icon sat unused in the exe. | ||
| 8 | GLFW_ICON ICON "rc/bitcoin.ico" | ||