Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows XP Balloon Tips?

277 views
Skip to first unread message

Daniel Bickett

unread,
Oct 11, 2004, 12:49:39 PM10/11/04
to pytho...@python.org
Hi,

The truth is I despise windows xp balloon tips. Well, not so much the
balloon tips, but how they're used by the operating system: like I
need my system tray to tell me when there are "unused icons" on my
desktop, or that "local disk" has less than 200 mb of free space. But
I digress

I liked the way GTray told me when I had new mail using the balloon
tip, and so when I replicated the program in python for use with
Private Messages on message boards, I naturally was interested in how
to achieve the same result.

I've searched comp.lang.python, google, the python chm, and the python
for windows chm, and none of them have yielded a single result.
When the Python for Windows docs didn't have anything I figured it
just wasn't possible yet, but I decided to ask here anyway. So, does
anyone know of a way to use the Windows XP Balloon Tip feature with
python? (namely wxPython, considering that's the GUI I use)

Thanks for your time,
Daniel Bickett

Dave Brueck

unread,
Oct 11, 2004, 1:07:50 PM10/11/04
to pytho...@python.org
Daniel Bickett wrote:
> I liked the way GTray told me when I had new mail using the balloon
> tip, and so when I replicated the program in python for use with
> Private Messages on message boards, I naturally was interested in how
> to achieve the same result.
>
> I've searched comp.lang.python, google, the python chm, and the python
> for windows chm, and none of them have yielded a single result.
> When the Python for Windows docs didn't have anything I figured it
> just wasn't possible yet, but I decided to ask here anyway. So, does
> anyone know of a way to use the Windows XP Balloon Tip feature with
> python? (namely wxPython, considering that's the GUI I use)

Yep, very possible - we use it in one of our apps (the internal debate wrt
whether or not we should have a tray icon is another story ;-) ). If you just
need to display the balloons then you can use ctypes to call the
shell32.Shell_NotifyIconA function (Google for NotifyIcon on MSDN to learn the
gory details).

If you also want to receive messages (mouse over, click, etc.) then you'll need
to set up a message loop to handle the MSG_ICON_NOTIFY message - I used Venster
for that.

-Dave

Dave Benjamin

unread,
Oct 11, 2004, 3:07:28 PM10/11/04
to
In article <mailman.4714.1097514...@python.org>, Dave Brueck wrote:
>
> Yep, very possible - we use it in one of our apps (the internal debate wrt
> whether or not we should have a tray icon is another story ;-) ). If you just
> need to display the balloons then you can use ctypes to call the
> shell32.Shell_NotifyIconA function (Google for NotifyIcon on MSDN to learn the
> gory details).
>

Just out of curiosity, is there a way to do this also from PythonWin
(without having ctypes installed)?

--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."

Dave Brueck

unread,
Oct 11, 2004, 3:47:04 PM10/11/04
to pytho...@python.org
Dave Benjamin wrote:
> In article <mailman.4714.1097514...@python.org>, Dave Brueck wrote:
>
>>Yep, very possible - we use it in one of our apps (the internal debate wrt
>>whether or not we should have a tray icon is another story ;-) ). If you just
>>need to display the balloons then you can use ctypes to call the
>>shell32.Shell_NotifyIconA function (Google for NotifyIcon on MSDN to learn the
>>gory details).
>>
>
> Just out of curiosity, is there a way to do this also from PythonWin
> (without having ctypes installed)?

I haven't used pywin32 in a long time, but ASPN says Shell_NotifyIcon is supported:

http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin32/win32gui.html

So: probably doable, haven't tried it though.

-Dave

Thomas Heller

unread,
Oct 12, 2004, 4:24:40 AM10/12/04
to
Harald Massa <cpl.1...@spamgourmet.com> writes:

> Dave Benjamin,


>
>> Just out of curiosity, is there a way to do this also from PythonWin
>> (without having ctypes installed)?
>

> the game is called "AnimateWindow".
> I posted a ctypes-programm to pywin32 mailinglist two weeks ago. It just
> was not robust enough to go into the wiki.

You forgot to keep a reference to the callback function - a very common
error. I hope to make this much easier in the next ctypes version,
where ctypes does this itself automatically.

>
> With build 203 Python win32 extension by Mark Hammond also wrap the
> AnimateWindow function (on XP), but they came out yesterday so I just read
> the change notes that they do; did not find a demo. So... please download
> pywin32 and try :)))

Thomas

Christian

unread,
Oct 12, 2004, 2:18:47 PM10/12/04
to
Harald Massa <cpl.1...@spamgourmet.com> wrote in message news:<Xns958065DCDDA60cp...@195.20.224.116>...
> Dave Benjamin,

>
> > Just out of curiosity, is there a way to do this also from PythonWin
> > (without having ctypes installed)?
>
> the game is called "AnimateWindow".
> I posted a ctypes-programm to pywin32 mailinglist two weeks ago. It just
> was not robust enough to go into the wiki.

I could be wrong, but I don't think that you need to use AnimateWindow
to do a balloon tip. In recent versions of PyWin32 a simple call to
win32gui.Shell_NotifyIcon is all you need.

> With build 203 Python win32 extension by Mark Hammond also wrap the
> AnimateWindow function (on XP), but they came out yesterday so I just read
> the change notes that they do; did not find a demo. So... please download
> pywin32 and try :)))

I modified a taskbar icon demo (from
http://www.itamarst.org/software/) the other day to add a balloon tip
to it. I have the modified demo available at
http://www.dowski.com/python/taskbardemo.py.

Christian

0 new messages