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)
| 147 | // `sound` parameter to false. Also, to respect user quiet time and prevent |
| 148 | // displaying balloon notifications, set `quietMode` to true. |
| 149 | func (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. |
| 177 | func (s *SystrayIcon) Delete() error { |
no test coverage detected