Hi Hamish,
Can't you also use handle_systray in tray_wndproc? It seems a bit duplicate to me to have so similar logic twice.
On a sidenote, is there a free program to test against?
Regards,
Fabian Maurer