diff options
| author | joesis | 2018-10-19 18:37:54 -0700 |
|---|---|---|
| committer | GitHub | 2018-10-19 18:37:54 -0700 |
| commit | e31397f8c6928d98a8a9a7e80087aebcf0090beb (patch) | |
| tree | 04a7f511ef645b150129260be7a6ad0cdb68304a | |
| parent | a10eb7e349f34fea123d7b3f091dd84269a09e00 (diff) | |
| parent | b07ec466765d1da14041de6d616885f2929c364e (diff) | |
| download | systray-e31397f8c6928d98a8a9a7e80087aebcf0090beb.tar.bz2 | |
Merge pull request #69 from getlantern/pull-68
define ERROR_SUCCESS as syscall.Errno
| -rw-r--r-- | systray_windows.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/systray_windows.go b/systray_windows.go index 040cdbd..26a0f80 100644 --- a/systray_windows.go +++ b/systray_windows.go @@ -525,17 +525,14 @@ func (t *winTray) addSeparatorMenuItem(menuId int32) error { func (t *winTray) hideMenuItem(menuId int32) error { // https://msdn.microsoft.com/en-us/library/windows/desktop/ms647629(v=vs.85).aspx const MF_BYCOMMAND = 0x00000000 - const ERROR_SUCCESS = 0 + const ERROR_SUCCESS syscall.Errno = 0 res, _, err := pDeleteMenu.Call( uintptr(t.menu), uintptr(uint32(menuId)), MF_BYCOMMAND, ) - if res == 0 { - if int(err.(syscall.Errno)) == ERROR_SUCCESS { - return nil - } + if res == 0 && err.(syscall.Errno) != ERROR_SUCCESS { return err } |
