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

Function NewSystrayIcon

pkg/sys/shell.go:99–112  ·  view source on GitHub ↗

NewSystrayIcon creates a new systray icon instance.

(wnd Hwnd)

Source from the content-addressed store, hash-verified

97
98// NewSystrayIcon creates a new systray icon instance.
99func NewSystrayIcon(wnd Hwnd) (*SystrayIcon, error) {
100 var data NotifyIconData
101 data.Size = uint32(unsafe.Sizeof(data))
102 data.Flags = NotifyIconGUIDFlag | NotifyIconMessageFlag
103 data.GUIDItem = SystrayIconGUID
104 data.HWnd = wnd
105
106 err := ShellNotifyIcon(ShellAddIcon, &data)
107 si := &SystrayIcon{wnd: wnd}
108 if err != nil {
109 return nil, err
110 }
111 return si, nil
112}
113
114// SetIcon sets the tray icon.
115func (s *SystrayIcon) SetIcon(icon Hicon) error {

Callers 1

newSystrayFunction · 0.92

Calls 1

ShellNotifyIconFunction · 0.85

Tested by

no test coverage detected