[PyKDE] Windows systray application

Rob Knapp myddrin at myddrin.com
Tue Jun 28 15:26:22 BST 2005


On Tue, 2005-06-28 at 14:11 +0300, basse wrote:
> 
> Hi, I've been hunting for two days now a way to create an application with PyQT
> (on winXP), that will hide itself on systray. only things I found was some
> references to WM_ messages and winEventFilters.. but no real example what that
> means. 

AFAIK, QT doesn't currently have a class that allows this.  You will
need to use the win32api call SHELL_NOTIFYICON to create the icon, and
then I used the winEvent (I think, it's been about 2 years) to capture
the incoming WM_ messages.

> and some references on QT examples of icontray-program.. but that was outdated,
> and I couldn't make it work in python.. 
> 
> so, is there anyone that has managed to do this? 
> and how? 

Yes, I have.  Unfortunately the code was developed for a company I no
longer work for.  Otherwise, I would share.

There is a pure win32 example here.  The main changes are 1) create a
hidden widget, and make that the parent of the notify icon. (The parent
gets the events  you are interested in.)  Then override, winEvent (I'm
60% sure that is the name, I'm sure someone else (who has used QT more
recently than I ) would remember the correct one).  In that event
handler examine the LPARAM(again, I think) and compare to the WM_
constants you found.

This is a brief overview, but it should get you started, sorry I can't
be more help.

> 
> all information highly appreciated. 
> 
> thanks.
> 
> .b
> 
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
-- 
---
Rob "Myddrin" Knapp
myddrin at myddrin.com
http://www.myddrin.com




More information about the PyQt mailing list