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

Method ShowBalloonNotification

pkg/sys/shell.go:149–174  ·  view source on GitHub ↗

ShowBalloonNotification renders the balloon notification in the taskbar area. The icon is a customized notification icon provided by the application that should be used independently of the notification area icon. The balloon notification title appears in a larger font immediately above the text. Th

(title string, text string, sound, quietMode bool)

Source from the content-addressed store, hash-verified

147// `sound` parameter to false. Also, to respect user quiet time and prevent
148// displaying balloon notifications, set `quietMode` to true.
149func (s *SystrayIcon) ShowBalloonNotification(title string, text string, sound, quietMode bool) error {
150 var data NotifyIconData
151 data.Size = uint32(unsafe.Sizeof(data))
152 data.Flags = NotifyIconGUIDFlag | NotifyIconInfoFlag
153 data.InfoFlags = NotifyIconUserFlag | NotifyIconLargeIconFlag
154 if !sound {
155 data.InfoFlags |= NotifyIconNosoundFlag
156 }
157 if quietMode {
158 data.InfoFlags |= NotifyIconRespectQuietTimeFlag
159 }
160 data.GUIDItem = SystrayIconGUID
161 data.HWnd = s.wnd
162
163 s1, s2 := windows.StringToUTF16(title), windows.StringToUTF16(text)
164 if len(s1) > 64 {
165 s1 = s1[:64]
166 }
167 if len(s2) > 256 {
168 s2 = s2[:256]
169 }
170 copy(data.Info[:], s2)
171 copy(data.InfoTitle[:], s1)
172
173 return ShellNotifyIcon(ShellModifyIcon, &data)
174}
175
176// Delete deletes systray icon and disposes all resources.
177func (s *SystrayIcon) Delete() error {

Callers 1

handleMessageMethod · 0.80

Calls 1

ShellNotifyIconFunction · 0.85

Tested by

no test coverage detected