I think I see the intent of using WinSetState. I tried it but still had the problem that the task bar item was unresponsive.
I added a Function so I could monitor the window state. It seemed to follow what one would expect when Win+D activated, WinGetState was 23 so it was being seen as minimized, enabled etc.
I resolved the problem by adding the WinGetState line:
TraySetState(1) ; show
If BitAND(WinGetState("AutoIt Scripts"), 16) Then TraySetState(1) ; show
Func SpecialEvent() ; restore from tray
TraySetState(2) ; hide
That ensures the tray icon is visible when the GUI is minimized by whatever means. If externally minimized, the task bar item appeared as well as the tray icon but I can live with that (not a normal situation). I tried Melba23's lines on top of that addition - it did not immediately improve things so I called it a day. It's now usable.
Edited by JohnSAutoIt, 13 May 2012 - 01:19 AM.