Shoutbox

Shell_NotifyIconW Example - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Shell_NotifyIconW Example (/showthread.php?tid=72399)

Shell_NotifyIconW Example by matty on 03-07-2007 at 07:30 AM

This is an example of how to create an icon in the system tray and subclass it to receive the messages from icon.

I updated the code that I had originally developed because I received a PM asking why it didn't work.


RE: Shell_NotifyIconW Example by felipEx on 03-07-2007 at 07:52 AM

it's great. but there is not a popupmenu . anyway. thanks a lot  :) ++


RE: Shell_NotifyIconW Example by NanaFreak on 03-07-2007 at 07:54 AM

nice work there Matty 5/5 (Y)

i might use this for some scripts...


RE: Shell_NotifyIconW Example by John Anderton on 03-07-2007 at 08:37 AM

Tray icon for scripts? Hope they give an option for disabling it :dodgy:


RE: Shell_NotifyIconW Example by Eddie on 03-07-2007 at 08:47 AM

Nice creation :) will be cool creation for developers :)


RE: Shell_NotifyIconW Example by Volv on 03-07-2007 at 10:21 AM

quote:
Originally posted by Eddie
Nice creation :) will be cool creation for developers :)
And oh so annoying for users :p

EDIT: PS: Just because I think it will be annoying doesn't mean that what you've done, Matty, is bad. It's a nice accomplishment and could be useful but unfortunately I think developers will use it for all the wrong reasons :(
RE: Shell_NotifyIconW Example by matty on 03-07-2007 at 12:38 PM

quote:
Originally posted by Volv
quote:
Originally posted by Eddie
Nice creation :) will be cool creation for developers :)
And oh so annoying for users :p

EDIT: PS: Just because I think it will be annoying doesn't mean that what you've done, Matty, is bad. It's a nice accomplishment and could be useful but unfortunately I think developers will use it for all the wrong reasons :(

Agreed, however someone asked me for it.
RE: Shell_NotifyIconW Example by L. Coyote on 03-07-2007 at 01:44 PM

quote:
Originally posted by Volv
quote:
Originally posted by Eddie
Nice creation :) will be cool creation for developers :)
And oh so annoying for users :p

EDIT: PS: Just because I think it will be annoying doesn't mean that what you've done, Matty, is bad. It's a nice accomplishment and could be useful but unfortunately I think developers will use it for all the wrong reasons :(
While I agree with you to an extent, let's not exaggerate. :P If a script has something like a tray icon when it's not even needed, you know the script is not worth it, anyways. Or, using this knowledge, you take the icon down, if the script doesn't have an option for it. :P Good exercise, too.


Anyway...

It's very important (for me, at least) to know how to do these things. The more I see the Message cycle being used, the more I'm starting to understand it. And hopefully, soon I won't have to bother others to know how things are done.

So, again, Matty, thanks a lot! :D
RE: Shell_NotifyIconW Example by matty on 03-07-2007 at 05:47 PM

New Version: 0.2

Adds example of adding a context menu when you right click the the icon.


RE: Shell_NotifyIconW Example by CookieRevised on 03-07-2007 at 06:57 PM

There are some bugs though. The systray icon isn't properly removed/destroyed when you exit Messenger (polygamy).


RE: Shell_NotifyIconW Example by matty on 03-07-2007 at 06:59 PM

quote:
Originally posted by CookieRevised
There are some bugs though. The systray icon isn't properly removed/destroyed when you exit Messenger (polygamy).
That is easily fixed if you use a GlobalAtom of the Users Email address. And you can use the Atom as the ID of the icon and it will resolve that issue. Also it screws up with Messenger Lock. Messenger Lock changes the icon we created not the Messenger one.
RE: Shell_NotifyIconW Example by CookieRevised on 03-07-2007 at 07:10 PM

quote:
Originally posted by Matty
Messenger Lock changes the icon we created not the Messenger one.
lol, indeed.... bug in Plus! I'd say...

(or at least, a lazyness of Patchou to search for the first icon created by the Messenger process, instead of checking the *magic* id 40046?... I think :p)
RE: Shell_NotifyIconW Example by Patchou on 03-07-2007 at 07:23 PM

that's not lazyness, all the countrary... I dont want to search for any "magic" id as you say, one of the many thigns that make Messenger Plus! resistant to Messenger updates.

I'll find a way to fix it for you.


RE: Shell_NotifyIconW Example by matty on 03-07-2007 at 07:29 PM

Here is another update

Version 0.3

Includes Polygamy Support and proper adding and removing of the icon when the user signs in and out.


RE: Shell_NotifyIconW Example by CookieRevised on 03-07-2007 at 07:42 PM

quote:
Originally posted by Patchou
that's not lazyness, all the countrary... I dont want to search for any "magic" id as you say, one of the many thigns that make Messenger Plus! resistant to Messenger updates.

I'll find a way to fix it for you.
but... but... but... :p

I guess you're right, although that number has never changed since version xxx (can't remember, at least 7.0 though...). And if it is, there are tricks to find out that number from the source, no?
RE: Shell_NotifyIconW Example by felipEx on 03-07-2007 at 08:00 PM

i like that  :)

code:
    if (Messenger.MyStatus > 0) {
        /*     Call the function to create the icon    */
        CreateIcon();
    }


you forgotten the offline users :D
RE: Shell_NotifyIconW Example by Patchou on 03-07-2007 at 08:18 PM

yes there is a trick: it's by monitoring additions of icons and checkign the id that's being added.. which is what I'm doing :p.

Bug fixed btw, it was caused by a stupid mistake made in a patch for version 4.10 or something like that to detect when the icon was being readded following explorer.exe being killed and reinstanciated.


RE: RE: Shell_NotifyIconW Example by deAd on 03-07-2007 at 11:39 PM

quote:
Originally posted by Patchou
yes there is a trick: it's by monitoring additions of icons and checkign the id that's being added.. which is what I'm doing :p.
you could also loop through the icons and get each's associated handle and id (among other things), but what you're doing is definitely better :P