What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Toast popup

Toast popup
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Toast popup
quote:
js code:
...
var hWnd = Interop.Call("user32", "FindWindowW", "msblpopupmsgwclass", 0); // Find the toast window
if(hWnd != null){ // If we found one
    Interop.Call ( 'user32' , 'SendMessageW' , hWnd , WM_CLOSE, 0 , 0 ) ; // Close it
}
...

You might wanna repeat that until you don't find any windows anymore. There could be multiple toasts at the same moment.
Also, that code is not polygamy safe (every code should be made polygamy safe if possible).

This will fix all that:
js code:
...
var tIDCurrent = Interop.Call('Kernel32', 'GetCurrentThreadId');
var hWnd = 0;
while (hWnd = Interop.Call('User32', 'FindWindowW', 'MSBLPopupMsgWClass', 0)) {
    if (Interop.Call('User32', 'GetWindowThreadProcessId', hWnd, 0) === tIDCurrent) {
        Interop.Call ('User32', 'SendMessageW', hWnd ,WM_CLOSE, 0, 0)
    }
}
...

-----

PS: SourSpud, it would still be better to actually turn off the option in Messenger though! Script like this are process intensive and might slow things down because of the use of that timer. Also, Plus! toasts aren't hidden by this. So you still need to disable some options in preferences anyways.


This post was edited on 11-25-2009 at 12:03 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-25-2009 11:41 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Toast popup - by SourSpud on 11-25-2009 at 05:31 AM
RE: Toast popup - by warmth on 11-25-2009 at 05:35 AM
RE: Toast popup - by SourSpud on 11-25-2009 at 05:55 AM
RE: Toast popup - by Spunky on 11-25-2009 at 09:37 AM
RE: Toast popup - by SourSpud on 11-25-2009 at 09:43 AM
RE: Toast popup - by Spunky on 11-25-2009 at 10:27 AM
RE: Toast popup - by SourSpud on 11-25-2009 at 10:40 AM
RE: Toast popup - by Spunky on 11-25-2009 at 10:53 AM
RE: Toast popup - by SourSpud on 11-25-2009 at 10:57 AM
RE: Toast popup - by CookieRevised on 11-25-2009 at 11:41 AM
RE: Toast popup - by SourSpud on 11-25-2009 at 10:25 PM
RE: Toast popup - by Spunky on 11-25-2009 at 11:33 PM
RE: Toast popup - by SourSpud on 11-26-2009 at 01:26 AM
RE: Toast popup - by CookieRevised on 11-26-2009 at 02:17 AM
RE: Toast popup - by SourSpud on 11-26-2009 at 04:03 AM
RE: Toast popup - by CookieRevised on 11-26-2009 at 09:28 AM
RE: Toast popup - by SourSpud on 11-27-2009 at 07:17 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