MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / createNotifyIconWindow

Method createNotifyIconWindow

cmd/systray/main_windows.go:145–175  ·  view source on GitHub ↗
(mod windows.Handle)

Source from the content-addressed store, hash-verified

143}
144
145func (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
177func (s *Systray) loadIconFromResource(mod windows.Handle) (windows.Handle, error) {
178 // find the icon in the same directory where the binary is loaded

Callers 1

newSystrayFunction · 0.95

Calls 2

RegisterClassFunction · 0.92
CreateWindowExFunction · 0.92

Tested by

no test coverage detected