mirror of
https://github.com/netbirdio/systray.git
synced 2026-05-22 17:08:41 -07:00
Merge pull request #69 from getlantern/pull-68
define ERROR_SUCCESS as syscall.Errno
This commit is contained in:
+2
-5
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user