[v3 windows] Support systray.Destroy()

This commit is contained in:
Lea Anthony 2023-06-06 20:40:56 +10:00
commit ff218e5323
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405

View file

@ -247,4 +247,13 @@ func (s *windowsSystemTray) setIconPosition(position int) {
}
func (s *windowsSystemTray) destroy() {
// Remove and delete the system tray
getNativeApplication().unregisterSystemTray(s)
s.menu.Destroy()
w32.DestroyWindow(s.hwnd)
// Destroy the notification icon
nid := s.newNotifyIconData()
if !w32.ShellNotifyIcon(w32.NIM_DELETE, &nid) {
globalApplication.info(syscall.GetLastError().Error())
}
}