[spambayes-dev] RE: [Spambayes] Outlook Envelope Tray Icon
Bob Chojnacki
bob at jellyvision.com
Fri Nov 7 13:40:33 EST 2003
> Now, the *really* tricky part is figuring out when to remove the icon.
I noticed right after I sent my email (blush) the comment in their code
' add some code to check whether the latest items are "interesting"
The comment is akin to the old Steve Martin comedy routine:
"How to become a millionaire. First, get a million dollars..."
Sorry about that.
Bob
> -----Original Message-----
> From: Kenny Pitt [mailto:kennypitt at hotmail.com]
> Sent: Friday, November 07, 2003 12:14 PM
> To: 'Bob Chojnacki'; spambayes at python.org
> Cc: spambayes-dev at python.org
> Subject: RE: [Spambayes] Outlook Envelope Tray Icon
>
>
> Bob Chojnacki wrote:
> > Hi,
> >
> > I really like SpamBayes and the Outlook plugin. It is working much
> > better than other spam filters, considering I get 85-95% spam. I am
> > currently using version 008.1. I read your FAQ about the problems
> > with making the Outlook envelope tray icon go away. (I am also not
> > sure if this is the right email address to send this comment, so
> > please bear with me if it isn't.)
> >
> > Is the following link helpful? (Keep in mind that I am not a Windows
> > programmer):
> >
> > http://www.slipstick.com/dev/code/clearenvicon.htm
>
> Thanks for the link. I created the following code to implement this in
> the Outlook plugin and attached it to a menu item for testing. It was,
> in fact, successful in removing the new mail envelope from the taskbar.
> Now, the *really* tricky part is figuring out when to remove the icon.
>
> ====================
>
> def RemoveNewMailIcon():
> win32gui.EnumWindows(_removeIconCallback, None)
>
> def _removeIconCallback(hwnd, extra):
> # Check for Outlook window class.
> if win32gui.GetClassName(hwnd) == "rctrl_renwnd32":
> # Got the correct class, but we need to make sure window title
> is
> # empty because there may be other top-level Outlook windows.
> if win32gui.GetWindowText(hwnd) == "":
> return not _killNewMailIcon(hwnd)
> else:
> return True
> else:
> return True
>
> WUM_RESETNOTIFICATION = win32con.WM_USER + 7
> def _killNewMailIcon(hwnd):
> nid = (hwnd, 0)
> if not win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid):
> return False
> else:
> win32gui.SendMessage(hwnd, WUM_RESETNOTIFICATION, 0, 0)
> return True
>
> ====================
>
> --
> Kenny Pitt
More information about the spambayes-dev
mailing list