Shoutbox

[RELEASE] MSN Popup Spy - 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: [RELEASE] MSN Popup Spy (/showthread.php?tid=69302)

[RELEASE] MSN Popup Spy by felipEx on 12-09-2006 at 05:17 PM

Title:  MSN Popup Spy

Short Description:
it kill msn popups and it shows in a list, the description of each popup
note: you can configure the  list's window opacity & visibility

Created by .felipE
version: 1.0


latest version:
http://shoutbox.menthix.net/attachment.php?pid=788202


RE: [RELEASE] MSN Popup Spy by -dt- on 12-09-2006 at 05:21 PM

theres a bug in your code, you're passing hex values as strings you should remove the quotes to make them numbers :)

orginal

code:
Interop.Call("User32", "AnimateWindow", Wnd.Handle, 180, "0x10000" | "0x80000");


fixed
code:
Interop.Call("User32", "AnimateWindow", Wnd.Handle, 180, 0x10000 | 0x80000);


RE: [RELEASE] MSN Popup Spy by Felu on 12-09-2006 at 06:03 PM

Nice

Use the Edit Button[Image: edit.gif] Next time [Image: msn_happy.gif]

I know you are using a translator to view this page [Image: msn_tongue.gif].

Did you block me @ WLM?


RE: [RELEASE] MSN Popup Spy by Kenji on 12-09-2006 at 06:06 PM

Nice script, come in use when im doing stuff but set to away :P

quote:
Originally posted by -!Felu!-
[size]Did you block me @ WLM?[/size]

Seems like every one is blocking you lately.

you phail at mycode

RE: [RELEASE] MSN Popup Spy by Squelettor on 02-08-2007 at 02:43 PM

Can you kill Messenger Plus! Live popups to ?

code:
var lngNotify = Interop.Call("user32","FindWindowW","msblpopupmsgwclass",0);

What is the "msblpopupmsgwclass" for Messenger Plus! Live ?
RE: [RELEASE] MSN Popup Spy by Felu on 02-08-2007 at 03:42 PM

"MessengerPlusLive_ToastPopupParent" is the class for MP!L popups. Doing the same with MP!L toasts is very much possible but there quite a few things need to be edited.


RE: [RELEASE] MSN Popup Spy by Oxy on 02-08-2007 at 05:11 PM

Is there anyway to end the script without going into plus!> preferences? If not, can you make one?


RE: [RELEASE] MSN Popup Spy by Squelettor on 02-09-2007 at 11:16 AM

version 1.5

-> close all toast (wlm and mpl)
-> better menu

Thanks to pH ^^


RE: [RELEASE] MSN Popup Spy by Felu on 02-09-2007 at 11:37 AM

You need to save the ScriptInfo.xml file as Unicode [Image: msn_wink.gif]. Also the windows.xml isn't valid :S. The script menu fails. And do you have permission for editing this script?


RE: [RELEASE] MSN Popup Spy by Squelettor on 02-09-2007 at 12:25 PM

quote:
Originally posted by Felu
You need to save the ScriptInfo.xml file as Unicode [Image: msn_wink.gif]. Also the windows.xml isn't valid :S. The script menu fails. And do you have permission for editing this script?


Oups, this is good now.

All the script are not in free license ?
RE: [RELEASE] MSN Popup Spy by Wally on 02-09-2007 at 01:20 PM

is there a better english version of this?[Image: msn_happy.gif] if not  is it possible to make one?


[RELEASE] MSN Popup Spy by sufor on 02-09-2007 at 01:30 PM

Here a beta English Version
Only interface is translated (some comments in source are in french)
But it works fine !


RE: [RELEASE] MSN Popup Spy by Wally on 02-09-2007 at 01:39 PM

thanks sufor it works just fine :)


RE: [RELEASE] MSN Popup Spy by Felu on 02-09-2007 at 01:50 PM

Your code doesn't get the text from any MP!L Toasts. As i said before there need to be some modifications to get the text of MP!L toasts. Also, did you test the script before uploading it?


RE: [RELEASE] MSN Popup Spy by sufor on 02-09-2007 at 01:56 PM

We haven't (yet) found solution to get the text from any MP!L Toasts but script detect this toasts.

You said "did you test the script before uploading it?". Did you find a bug?


RE: [RELEASE] MSN Popup Spy by Felu on 02-09-2007 at 02:12 PM

The notification window doesn't have any notification text. I.e. the text displayed in the MP!L toasts is not displayed in the notification window. Also the script takes about 1 second to close the toast. Without this the script makes no sense to me.


RE: [RELEASE] MSN Popup Spy by felipEx on 02-09-2007 at 08:46 PM

very good :)

how to get the text displayed in MP!L Toasts?

lngNotify = Interop.Call("user32","FindWindowW","#32770","");
lngNotify_Static = Interop.Call('User32',"FindWindowExW", lngNotify, 0, 'Static',0);
addNotification(strGettext(lngNotify_Static));

:)


[RELEASE] MSN Popup Spy by sufor on 02-09-2007 at 09:17 PM

A new version of the script is released !
The notification window now displays all popups (MSN Popup and Messenger Plus Popup).
Thanks to felipE for the solution !
I hadn't thought about FindWindowExW (only FindWindowW)


RE: [RELEASE] MSN Popup Spy by vaccination on 02-09-2007 at 09:41 PM

Heh, i like this script, thank a lot! =D


RE: [RELEASE] MSN Popup Spy by Felu on 02-10-2007 at 06:12 AM

This version doesn't work aswell :S.

Here is a working one ;).

Known Bugs:
1) Doesn't work for contact toasts :(. (Will try to fix that)


removed on request by cookie


RE: [RELEASE] MSN Popup Spy by Squelettor on 02-10-2007 at 04:51 PM

Thanks Felu


RE: [RELEASE] MSN Popup Spy by felipEx on 02-12-2007 at 02:00 AM

there is another version
please, check this :)

this include fixed bugs  and resizable window  :D


RE: [RELEASE] MSN Popup Spy by • MaNiC MoE • on 02-12-2007 at 12:17 PM

thx :)


RE: [RELEASE] MSN Popup Spy by sufor on 02-13-2007 at 10:24 AM

good ^^.

it's a great tip for me :p :
if (eval("typeof(" + function_handler + ")") == "function") {
   eval(function_handler + "(PlusWnd);");
}


RE: [RELEASE] MSN Popup Spy by Boo B on 02-13-2007 at 09:18 PM

you should be able to choose :
the size of your window
what gets blocked and transfered in window
and what would be handy is
when in full screen (only for people with second screen :))
or just always :p
everything someone says comes there
instance:
(¯`•._.•[Nick]•._... says: qskjdfqsdf
Naomi says: lqkjdfhqf
KeNNy (*) Same Da... says: qlkdfqsdf

don't say you need to make that for me but i just think taht would be handy :D:D


RE: RE: [RELEASE] MSN Popup Spy by felipEx on 02-13-2007 at 09:25 PM

quote:
Originally posted by sufor
good ^^

it's a great tip for me :p :
if (eval("typeof(" + function_handler + ")") == "function") {
   eval(function_handler + "(PlusWnd);");
}


thanks to Choli for them  :P  (i'm felipex at foro.msgpluslive.es)
RE: [RELEASE] MSN Popup Spy by CookieRevised on 02-13-2007 at 09:41 PM

quote:
Originally posted by afelipE_scripts
how to get the text displayed in MP!L Toasts?

lngNotify = Interop.Call("user32","FindWindowW","#32770","");
lngNotify_Static = Interop.Call('User32',"FindWindowExW", lngNotify, 0, 'Static',0);
addNotification(strGettext(lngNotify_Static));
You do know that "#32770" is not an unique class for windows? Many windows in Windows have "#32770" as a class and it by no means uniquely identifies Plus! Toast windows... Aka: do not use that.









And may I very strongly point out that:

1)
quote:
Originally posted by Squelettor
quote:
Originally posted by Felu
Do you have permission for editing this script?
All the script are not in free license ?
No! It isn't because they are open-source that you can copy them and release them again without the permission of the author!



2) Can you all please stop posting variants of this script please!!! If a script needs updating, then contact the author instead.
And as for the author, update the FIRST post in this thread with the new version.

All this because with all these variations and versions of this script it is majorly confussing to forum users what to download. Remember that not everybody will scroll thru entire threads, and even less people will actually read posts to know what has changed or not.

Again, if a script is released there should only be ONE attachment in the entire thread, the one from the first post.

Also, if you are not the original author and you attach a new version of a script to your post for whatever reason, then PLEASE check it out for bugs. It is already bad that people attach new versions at random, let alone that those 'new' versions are actually worse....

So...
- afelipE_scripts: update your first post in this thread with the latest version.
- And to all others: please remove all your attachments.
- afelipE_scripts: before posting a script, test it for (obvious) bugs
- afelipE_scripts and Squelettor: please don't double post. Edit your post instead if you want to add something
- Cookie: stop ranting, although it needs to be done from time to time.
RE: [RELEASE] MSN Popup Spy by felipEx on 02-15-2007 at 08:01 PM

and what I can do to fix it? ms spy++ returns those values

I must count the number of controls of the window to make sure that is a mptoast?

sorry for my bad english, i'm learning it. :D


RE: [RELEASE] MSN Popup Spy by CookieRevised on 02-20-2007 at 02:54 AM

quote:
Originally posted by afelipE_scripts
and what I can do to fix it? ms spy++ returns those values

I must count the number of controls of the window to make sure that is
It is not because spy++ reports it that that is the class name that you can use it to uniquely identify a window.... A class is rarely something "unique"... and class #32770 is even one of the least 'unique' classes as almost every program has such windows since they are generic "dialog window".

eg: even Plus! has more #32770 windows then just toasts. The floating contact windows are also of class #32770 (and also have two or three controls) to only name just one. The event viewer, script debugger, etc are also all #32770 classes. In fact every generic window (even script windows) are of class #32770.

You need to perform additional tests, which certainly do not end by counting the controls as that is again nothing unique. Start by looking only to #32770 windows which are created from the same thread and/or process and importantly check its owner and parent window which should be of class "MessengerPlusLive_ToastPopupParent".

And checking upon that ToastParent class instead of trying to find #32770 class windows is the proper method since that will already give you (by getting its children) all toasts at once without having the extreme overhead of checking each #32770 class window in Windows (because as said, there are extremely many), counting controls or whatever other certainly not unique and slow method....

Because also note that Plus! toasts can have more then just two controls, there are at least two different kind of toasts. For Messenger toasts this is the same, there is more then one kind...

--------------------

Other remarks:

First of all, it is a very nice idea for a script, however:

The script is not polygamy proof...






code:
if (!MessengerStart)    {
    OnEvent_SigninReady(Messenger.MyEmail);
}
This will fail since scripts can be restarted before the user is logged in. Don't check upon MessengerStart, but check upon the user's status:
if (Messenger.MyStatus > 1) OnEvent_SigninReady(Messenger.MyEmail);






code:
function ReadRegistry(key){
     try     {
      var toReturn = new ActiveXObject("WScript.Shell").RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key);
     }
     catch( e)     {
      var toReturn = 0;
     }
     finally     {
        return(toReturn);
     }
}
===>
code:
function ReadRegistry(key){
        try {
                return Number(new ActiveXObject("WScript.Shell").RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key));
        } catch( e) {
                // Set here your default value
                return 200
        }
}
Same principle for writeregistry.
And change REG_SZ in the writeregistry function to REG_DWORD.






code:
while (PlusWnd.LstBox_GetCount('lista')>0)         {
        PlusWnd.LstBox_RemoveItem('lista',0);
}
===>
code:
for (var i = PlusWnd.LstBox_GetCount('lista'); i > 0; )
        PlusWnd.LstBox_RemoveItem('lista',--i);
shorter and faster.






code:
function OnEvent_SigninReady(Email){
    try     {
        var firstrun = new ActiveXObject("WScript.Shell").RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\opacity");
    } catch( e) {
         WriteRegistry("opacity","200");
    }
}
Please do not write stuff to the registry when it is not needed. This is a extremely bad habit.

The only time you should write something to the registry is in this save(PlusWnd) function. Nowhere else.

To read a value from the registry you should need to take in account that it doesn't exist. But if it doesn't exist (try/catch statements) NEVER write to the registry!, instead set your script value to the default value. There is really no need to clog up the registry for that.

As it is now, the SigninReady() function does not need to contain anything at all, since you do not need to check in this function upon existing settings if you aren't going to set it to some global variable.






code:
function strGettext(lngHwnd) {
    var ilngLength = Interop.Call("user32","SendMessageA",lngHwnd,14,0,0);
    var strBuffer = "";
    for (var x=0; x<ilngLength; x++) {
        strBuffer+=" ";
    }
    Interop.Call("user32","SendMessageW",lngHwnd,13,ilngLength+1,strBuffer);
    return(strBuffer);
}
That wont work. Variables in JScript are not passed by reference (they can't recieve values like that). You need to define and use a Plus! DataBlock for that.
===>
code:
function strGettext(lngHwnd) {
        var ilngLength = Interop.Call("user32", "SendMessageW", lngHwnd, /*WM_GETTEXTLENGTH*/ 0x0E, 0, 0);
        var strBuffer = Interop.Allocate(ilngLength * 2 + 2);
        Interop.Call("user32", "SendMessageW", lngHwnd, /*WM_GETTEXT*/ 0x0D, ilngLength+1, strBuffer.DataPtr);
        return strBuffer.ReadString(0);
}






code:
function OnEvent_Initialize(MessengerStart){
    Plus_WndNotification = MsgPlus.CreateWnd("window.xml","WndNotification", 1);
}
You should not display the window when the script (re)starts. It is of no use since if the user isn't logged in yet, he also can't recieve notifications either. The window should be displayed if the user is signed in.
===>
code:
function OnEvent_Initialize(bMessengerStart){
        if (Messenger.MyStatus > 1) OnEvent_SignIn(Messenger.MyMail);
}
function OnEvent_SignIn(sEmail){
        Plus_WndNotification = MsgPlus.CreateWnd("window.xml","WndNotification", 1);
        // It is also here that you should make this polygamy aware
}






code:
var heure = (date.getHours() < 10) ? "0" + date.getHours() + sep : date.getHours() + sep;
===>
code:
var heure = (date.getHours() < 10 ? "0" : "") + date.getHours() + sep;






code:
if (Plus_WndNotification.LstBox_GetCount("lista")>0) {
        Plus_WndNotification.LstBox_SetCurSel("lista", Plus_WndNotification.LstBox_GetCount("lista")-1);
    }
That check is not needed since you will always have an element in your list






code:
function cancel(PlusWnd){
    PlusWnd.visible=false;
}
There is no need to always keep the config window open. This is a bad habit. Close it when the user is done with it and reopen it when requested.
===>
code:
function cancel(PlusWnd){
    PlusWnd.Close(0);
}
same for all equivalent lines for the config window.







code:
if (!Plus_WndConfiguration.visible) {
        Plus_WndConfiguration.visible=true;
}
else                               {
        Plus_WndConfiguration.visible=false;
}
===>
code:
Plus_WndConfiguration.visible = !Plus_WndConfiguration.visible;
But note that you should not use this as I said earlier. The config window should be closed properly. If you don't do that you will have bad behaviour (eg: when the congif window is open, select it again from the menu, you'll see it will be closed (aka hidden in this case) again). Properly close the window instead... In other words, the entire
code:
if (!Plus_WndConfiguration.visible) {
    Plus_WndConfiguration.visible=true;
} else {
    Plus_WndConfiguration.visible=false;
}
should be removed.






code:
function OnEvent_Timer(TimerId){ ... }
The main core of this script, contains a lot of bugs and doesn't work properly






I hope these remarks are of any help....