SetTooltip sets the tray icon tooltip.
(tooltip string)
| 124 | |
| 125 | // SetTooltip sets the tray icon tooltip. |
| 126 | func (s *SystrayIcon) SetTooltip(tooltip string) error { |
| 127 | var data NotifyIconData |
| 128 | data.Size = uint32(unsafe.Sizeof(data)) |
| 129 | data.Flags = NotifyIconGUIDFlag | NotifyIconTipFlag |
| 130 | data.GUIDItem = SystrayIconGUID |
| 131 | data.HWnd = s.wnd |
| 132 | tip := windows.StringToUTF16(tooltip) |
| 133 | if len(tip) > 128 { |
| 134 | tip = tip[:128] |
| 135 | } |
| 136 | copy(data.Tip[:], tip) |
| 137 | return ShellNotifyIcon(ShellModifyIcon, &data) |
| 138 | } |
| 139 | |
| 140 | // ShowBalloonNotification renders the balloon notification |
| 141 | // in the taskbar area. The icon is a customized notification |
no test coverage detected