(mod windows.Handle)
| 143 | } |
| 144 | |
| 145 | func (s *Systray) createNotifyIconWindow(mod windows.Handle) (sys.Hwnd, error) { |
| 146 | // register notification icon window class |
| 147 | var wc sys.WndClassEx |
| 148 | wc.Size = uint32(unsafe.Sizeof(wc)) |
| 149 | wc.Instance = mod |
| 150 | wc.WndProc = windows.NewCallback(s.wndProc) |
| 151 | wc.ClassName = className |
| 152 | err := sys.RegisterClass(&wc) |
| 153 | if err != nil { |
| 154 | return sys.InvalidHwnd, err |
| 155 | } |
| 156 | // create the notification icon window |
| 157 | hwnd, err := sys.CreateWindowEx( |
| 158 | 0, |
| 159 | className, |
| 160 | className, |
| 161 | sys.WindowStyleOverlapped, |
| 162 | sys.CwUseDefault, |
| 163 | sys.CwUseDefault, |
| 164 | 100, |
| 165 | 100, |
| 166 | 0, |
| 167 | 0, |
| 168 | mod, |
| 169 | 0, |
| 170 | ) |
| 171 | if err != nil { |
| 172 | return sys.InvalidHwnd, err |
| 173 | } |
| 174 | return hwnd, nil |
| 175 | } |
| 176 | |
| 177 | func (s *Systray) loadIconFromResource(mod windows.Handle) (windows.Handle, error) { |
| 178 | // find the icon in the same directory where the binary is loaded |
no test coverage detected