What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help: How to write code that hides system tray icon

Help: How to write code that hides system tray icon
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Help: How to write code that hides system tray icon
quote:
Originally posted by Matty
This process is long and drawn out
(...)
You need to basically get the handle of the icons and enumerate through them till you find the one relating to msnmsgr.exe.
This isn't true though... To be able to use this Shell_NotifyIcon API you don't need all the fancy stuff -dt- does in his class as that is a serious big unneeded detour.

quote:
Originally posted by Matty
If you want to see an example of getting the handle of the icons take a look at -dt-'s script to change the tooltip of the icon to include your email and status.
[Release] Email tooltip
IMHO, way too complicated and uses many really unneeded stuff.

All you basically need is Shell_NotifyIcon API, nothing more and with that you can indeed change tooltips, remove icons, add icons, etc in only a few lines of codes (no need for hidden plus windows, enumerating icons, getting handles to icons, etc <= which is why -dt-'s script is seriously bloated IMHO):


To remove the icon:
code:
function RemoveTrayIcon() {
        var NIM_DELETE = 0x2;
        var NOTIFYICONDATA = Interop.Allocate(88);
        with (NOTIFYICONDATA) {
                WriteDWORD(0, NOTIFYICONDATA.Size);
                WriteDWORD(4, GetMSNHiddenWindowHandle());
                WriteDWORD(8, 40046);
        }
        Interop.Call('shell32.dll', 'Shell_NotifyIconA', NIM_DELETE, NOTIFYICONDATA);
}

function GetMSNHiddenWindowHandle() {
        var tIDCurrent = Interop.Call('Kernel32', 'GetCurrentThreadId');
        var hWnd = 0;
        while (hWnd = Interop.Call('User32', 'FindWindowExW', 0, hWnd, 'MSNHiddenWindowClass', 0))
                if (Interop.Call('User32', 'GetWindowThreadProcessId', hWnd, 0) === tIDCurrent)
                        return hWnd;
}


to alter the tooltip, remove icon, readd icon, it is all similar and equally short... see attached script:


edit: change some lines

.plsc File Attachment: TrayIcon Manipulation.plsc (2.02 KB)
This file has been downloaded 260 time(s).

This post was edited on 03-06-2007 at 01:15 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-13-2006 09:26 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help: How to write code that hides system tray icon - by Black_Ice on 06-29-2006 at 02:08 AM
RE: Help: How to write code that hides system tray icon - by rob_botch on 06-29-2006 at 09:33 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 06-29-2006 at 09:41 AM
RE: Help: How to write code that hides system tray icon - by rob_botch on 06-29-2006 at 09:43 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 06-29-2006 at 09:45 AM
RE: Help: How to write code that hides system tray icon - by rob_botch on 06-29-2006 at 09:46 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 06-29-2006 at 09:47 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-13-2006 at 04:21 AM
RE: Help: How to write code that hides system tray icon - by matty on 08-13-2006 at 04:45 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-13-2006 at 08:51 AM
RE: RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-13-2006 at 09:26 PM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-14-2006 at 01:18 PM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-14-2006 at 09:40 PM
RE: Help: How to write code that hides system tray icon - by hmaster on 08-14-2006 at 10:04 PM
RE: Help: How to write code that hides system tray icon - by ecion on 08-14-2006 at 10:39 PM
RE: Help: How to write code that hides system tray icon - by matty on 08-15-2006 at 01:18 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 07:59 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 11:12 AM
RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-15-2006 at 11:14 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 11:42 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 11:44 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 11:45 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 11:47 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 11:48 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 11:49 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 12:00 PM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 12:03 PM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-15-2006 at 12:04 PM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-15-2006 at 12:13 PM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-16-2006 at 08:12 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-17-2006 at 10:56 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-17-2006 at 11:06 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-17-2006 at 11:07 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-17-2006 at 11:10 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-17-2006 at 11:12 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-17-2006 at 11:19 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-17-2006 at 11:20 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-17-2006 at 11:23 AM
RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-19-2006 at 09:12 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-19-2006 at 09:17 AM
RE: RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-19-2006 at 09:31 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-19-2006 at 09:47 AM
RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-19-2006 at 10:35 AM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 08-19-2006 at 10:41 AM
RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-19-2006 at 11:52 AM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-19-2006 at 01:22 PM
RE: RE: Help: How to write code that hides system tray icon - by CookieRevised on 08-19-2006 at 01:47 PM
RE: Help: How to write code that hides system tray icon - by shrav/oo7` on 08-19-2006 at 01:53 PM
RE: Help: How to write code that hides system tray icon - by Black_Ice on 01-22-2007 at 01:00 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On