aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYevhen Hrubiian2019-01-10 16:52:56 +0200
committerYevhen Hrubiian2019-01-10 16:52:56 +0200
commit42b54dae2e8ea291a213c6398fe597a33ec5bd37 (patch)
treeeb4c02d1cc0098c9eebb259b2d34bbbcaec7cedb
parenteaad7114094d8a1b1b7188c062fa7f0fe21ac9b0 (diff)
downloadsystray-42b54dae2e8ea291a213c6398fe597a33ec5bd37.tar.bz2
fixed bad-looking icon issue on windows
-rw-r--r--systray_windows.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/systray_windows.go b/systray_windows.go
index 9bbb3d1..42984e1 100644
--- a/systray_windows.go
+++ b/systray_windows.go
@@ -183,6 +183,7 @@ type winTray struct {
func (t *winTray) setIcon(src string) error {
const IMAGE_ICON = 1 // Loads an icon
const LR_LOADFROMFILE = 0x00000010 // Loads the stand-alone image from the file
+ const LR_DEFAULTSIZE = 0x00000040 // Loads default-size icon for windows(16 x 16) if cx, cy are set to zero
const NIF_ICON = 0x00000002
// Save and reuse handles of loaded images
@@ -196,9 +197,9 @@ func (t *winTray) setIcon(src string) error {
0,
uintptr(unsafe.Pointer(srcPtr)),
IMAGE_ICON,
- 64,
- 64,
- LR_LOADFROMFILE,
+ 0,
+ 0,
+ LR_LOADFROMFILE|LR_DEFAULTSIZE,
)
if res == 0 {
return err