Hello,

I have a Windows application that places an icon in the System Tray (modified the old trayicon example to work under Qt4). My question is; When I minimize my application, I want to remove it from the taskbar. I couldn't figure out how to do this using the changeEvent or hideEvent (I think because it's a spontaneous event). To solve this, I ended up having to reimplement the winEvent function as such:
Qt Code:
  1. bool winEvent( MSG *m, long *result )
  2. {
  3. if ( mintotray )
  4. {
  5. switch ( m->message )
  6. {
  7. case WM_SIZE:
  8. {
  9. if ( m->wParam == SIZE_MINIMIZED )
  10. {
  11. ShowWindow(winId(), SW_HIDE);
  12. return true;
  13. }
  14. }
  15. break;
  16. default:
  17. break;
  18. }
  19. }
  20.  
  21. return QWidget::winEvent(m, result);
  22. }
To copy to clipboard, switch view to plain text mode 

Is there a cleaner way to do this using Qt events?

Thanks in advance,
-d