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

Pages: (2): « First [ 1 ] 2 » Last »
Toast popup
Author: Message:
SourSpud
Junior Member
**

Avatar
spud, spud, spud, spoon.

Posts: 58
35 / Male / Flag
Joined: Nov 2009
O.P. Toast popup
Is there a way to hide the toast when you receive the first message from someone, like this.

* tim opens convo *
Tim Says: hey!

* toast on my screen *

Tim Says: Hey!

is there a script that can stop that from appearing?
11-25-2009 05:31 AM
Profile E-Mail PM Find Quote Report
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
RE: Toast popup
you can disable that in the settings of WLM by unchecking alert you when someone writes you my friend...
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
11-25-2009 05:35 AM
Profile PM Web Find Quote Report
SourSpud
Junior Member
**

Avatar
spud, spud, spud, spoon.

Posts: 58
35 / Male / Flag
Joined: Nov 2009
O.P. RE: Toast popup
thanks but i would also like to do this as a script. I found this http://www.msgpluslive.cl/scripts/view/224-MSN-Popup-Spy/ but id like to make it so i don't see anything at all.

This post was edited on 11-25-2009 at 05:57 AM by SourSpud.
11-25-2009 05:55 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Toast popup
Why? If there is already an option for it...
<Eljay> "Problems encountered: shit blew up" :zippy:
11-25-2009 09:37 AM
Profile PM Find Quote Report
SourSpud
Junior Member
**

Avatar
spud, spud, spud, spoon.

Posts: 58
35 / Male / Flag
Joined: Nov 2009
O.P. RE: Toast popup
because I am learning, i would like to know its doable, as far as i know it only works if you have that popup showing. If anyone can do it id appreciate it.

Kind Regards,
SourSpud
11-25-2009 09:43 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Toast popup
Edit the script you downloaded. You should be able to see how they did it and might be able to piece it together.
<Eljay> "Problems encountered: shit blew up" :zippy:
11-25-2009 10:27 AM
Profile PM Find Quote Report
SourSpud
Junior Member
**

Avatar
spud, spud, spud, spoon.

Posts: 58
35 / Male / Flag
Joined: Nov 2009
O.P. RE: Toast popup
Tried that mate, this is my result.

jscript code:
//  MSN Popup Spy   by   .felipE 
//       http://felipex.net
//                Mexico, Sinaloa, Los Mochis

var PlusWnd;
var show = true;
function OnuiEvent_CtrlClicked(Wnd, ControlId){
switch (ControlId){
case "cancel":
    Interop.Call("User32", "AnimateWindow", Wnd.Handle, 180, 0x10000 | 0x80000);
    Wnd.Close(1);
    break;
case "save":
WriteRegistry("opacity",Wnd.GetControlText("wp"));
WriteRegistry("showlist", ( Boolean(Wnd.Button_IsChecked("chk")) == true ? "True" : "False") );

if ( Boolean(Wnd.Button_IsChecked("chk")) == true ){
var Box = Interop.Call("user32","FindWindowW","#32770","Msn Popup Spy Box");
if (Box) Interop.Call("user32","PostMessageA",Box,16,0,0); PlusWnd = null;
}


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

    Wnd.Close(1);
    break;

}
}

function OnuiEvent_EditTextChanged(PlusWnd, ControlId){
if ( PlusWnd.GetControlText("wp") < 0 || PlusWnd.GetControlText("wp") > 255) PlusWnd.SetControlText("wp","0");
}

function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd){
switch (MenuItemId)
{
case "MnuConf":
{
PlusWnd = MsgPlus.CreateWnd("window.xml","ui");
PlusWnd.SetControlText("wp", ReadRegistry("opacity") );
PlusWnd.Button_SetCheckState("chk", ReadRegistry("showlist") );

break;
}

case "MnuAbout":
{
var Handle = (Location == 2 ? OriginWnd.Handle : Messenger.ContactListWndHandle);
Interop.Call("user32","MessageBoxW",Handle,"Created by\n    .felipE\n\n\nhttp://felipex.net\nhttp://messengeradictos.com","About MSN Popup Spy",64+4096);
//Interop.Call("shell32","ShellAboutW",Handle,"MSN Popup Spy","Created by .felipE\thttp://felipex.net",Handle);
break;
}


}
}

function OnEvent_Initialize(MessengerStart){
        PlusWnd = MsgPlus.CreateWnd("window.xml","msnbox",1);
        PlusWnd.visible=false;
        if(Messenger.MyStatus > 0){       
            OnEvent_SigninReady(Messenger.MyEmail);
        }
}

function OnEvent_SigninReady(Email){
      try     {
       var firstrun = new ActiveXObject("WScript.Shell").RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\showlist");
     }
     catch(e)     {
          WriteRegistry("opacity","200");
          WriteRegistry("showlist","False");
     }
     finally     {
        show = true;
        MsgPlus.AddTimer("msnpopupspy",100);
     }
}

function OnmsnboxEvent_Destroyed(PlusWndd,ExitCode){
show = true;
PlusWnd = null;
}

function OnEvent_Timer(TimerId){
var lngNotify = Interop.Call("user32","FindWindowW","msblpopupmsgwclass",0);
if (lngNotify)
{
var showlist = ReadRegistry("showlist");
if (showlist == "False")
{
        var c = ":";
        var d = new Date();
        var s = (d.getHours() < 10) ? "0" + d.getHours() + c : d.getHours() + c;
        s += (d.getMinutes() < 10) ? "0" + d.getMinutes() + c : d.getMinutes() + c;
        s += (d.getSeconds() < 10) ? "0" + d.getSeconds() : d.getSeconds();
       

       
        if (show){


      try     {
           PlusWnd.visible =  true;
     }
     catch(e)     {
        PlusWnd = MsgPlus.CreateWnd("window.xml","msnbox",1);
     }
     finally     {
        PlusWnd.visible = false;
        MakeWndTransparent(PlusWnd.Handle);
        show = true;
     }






        }




        PlusWnd.LstBox_AddItem("lista",s + " > " + strGettext(lngNotify));
        PlusWnd.SetControlText("lbltitle", "Notifications: " + PlusWnd.LstBox_GetCount("lista"));
}
else
{
        if (!PlusWnd)         {
        PlusWnd = MsgPlus.CreateWnd("window.xml","msnbox");
        PlusWnd.visible=false;
        show = false;
       
        }
}
       
        Interop.Call("user32","PostMessageA",lngNotify,16,0,0);
}

MsgPlus.AddTimer("msnpopupspy",100);
}

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);
}

function MakeWndTransparent(PlusWnd){
//  CODE : MSN PREVIEW BOX SCRIPT
  var Msg;
  var nMsg = Interop.Allocate(4);
  var GWL_STYLE = (-20);
  var LWA_ALPHA = 0x2;
  var WS_EX_LAYERED = 0x80000;
  var WS_EX_TRANSPARENT = 0x20;
  Msg = Interop.Call('user32', 'GetWindowLongW', PlusWnd, GWL_STYLE);
  nMsg.WriteDWORD(0, (Msg | WS_EX_LAYERED));
  Interop.Call('user32', 'SetWindowLongW', PlusWnd, GWL_STYLE, nMsg.ReadDWORD(0));
  vis = 1* ( Math.abs(ReadRegistry("opacity")) >=0 && Math.abs(ReadRegistry("opacity")) <256 ? Math.abs(ReadRegistry("opacity")) : 200);
  Interop.Call('user32', 'SetLayeredWindowAttributes', PlusWnd, 0, vis, LWA_ALPHA);
}

function WriteRegistry(key, value){
      try     {
      var toReturn = new ActiveXObject("WScript.Shell").RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserID + "\\" + key, value, "REG_SZ");
     }
     catch(e)     {
         var toReturn = 0;
     }
     finally     {
        return(toReturn);
     }
}

function ReadRegistry(key){
     try     {
      var toReturn = new ActiveXObject("WScript.Shell").RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + key);
     }
     catch(e)     {
      var toReturn = 0;
     }
     finally     {
        return(toReturn);
     }
}


xml code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <Window Id="msnbox" Version="1">
        <Attributes>
            <Caption>LOL</Caption>
            <TopMost>true</TopMost>
            <ShowInTaskbar>false</ShowInTaskbar>
        </Attributes>
       
        <TitleBar>
            <AllowMinimize>false</AllowMinimize>
            <AllowMaximize>false</AllowMaximize>
            <AllowClose>false</AllowClose>
        </TitleBar>
       
        <Position Width="450" Height="60"/>
        <DialogTmpl/>
        <WindowTmpl><Corners><RoundSize>1</RoundSize></Corners><Borders><Color><Alpha>255</Alpha></Color></Borders></WindowTmpl>
        <Controls>
            <Control xsi:type="StaticControl" Id="lbltitle">
                <Position Top="1" Left="5" Width="100" Height="55"/>
                <Caption>Notifications:</Caption>
            </Control>
            <Control xsi:type="ListBoxControl" Id="lista">
                <Position Top="10" Left="5" Width="438" Height="55"/>
            </Control>
        </Controls>
    </Window>
    <Window Id="ui" Version="1">
        <Attributes>
            <Caption>Configuration</Caption>
        </Attributes>
       
        <TitleBar>

            <AllowMinimize>false</AllowMinimize>
            <AllowMaximize>false</AllowMaximize>
            <AllowClose>false</AllowClose>
            <Title><Text>Configuration</Text></Title>
        </TitleBar>
       
        <Position Width="155" Height="220"/>
        <DialogTmpl>   
            <BottomBar Style="Plain">               
                <RightControls>
                    <Control xsi:type="ButtonControl" Id="save">
                        <Position Top="0" Width="50" Left="80"/>
                        <Caption>&amp;Save</Caption>
                        <Attributes>
                            <IsDefault>true</IsDefault>
                        </Attributes>
                    </Control>
                    <Control xsi:type="ButtonControl" Id="cancel">
                        <Position Top="0" Width="50" Left="0"/>
                        <Caption>&amp;Cancel</Caption>
                    </Control>
                </RightControls>
            </BottomBar>
        </DialogTmpl>
        <WindowTmpl></WindowTmpl>
        <Elements>
            <Element xsi:type="ImageElement" Id="logo">
                <Position Top="33" Left="10"/>
                <Image><Name>buddy-floatingnickname</Name></Image>
            </Element>
        </Elements>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="30" Left="30" Width="200" Height="16" />
                <Caption>MSN Popup Spy</Caption>
                <Transparency>200</Transparency>
                <Font><Bold>True</Bold><Size>16</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>

            <Control xsi:type="StaticControl" Id="lbltitle">
                <Position Top="45" Width="150" Left="40"/>
                <Caption>Configuration</Caption>
                <Transparency>130</Transparency>
                <Font><Bold>true</Bold><Size>7</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>

            <Control xsi:type="CheckBoxControl" Id="chk">
                <Position Top="115" Left="20" Width="125" Height="10"/>
                <Caption>Don't Show me the notifications' list</Caption>
            </Control>
            <Control xsi:type="StaticControl" Id="lbl02">
                <Position Top="125" Left="30" Width="80" Height="30"/>
                <Caption>Only kill Popups</Caption>
                <Transparency>160</Transparency>
            </Control>
   
       
            <Control xsi:type="StaticControl" Id="lblopacity">
                <Position Top="76" Width="150" Left="10"/>
                <Caption>Window Opacity</Caption>
                <Transparency>130</Transparency>
                <Font><Bold>true</Bold><Size>7</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>
            <Control xsi:type="StaticControl" Id="lblpopups">
                <Position Top="106" Width="150" Left="10"/>
                <Caption>MSN Popups</Caption>
                <Transparency>130</Transparency>
                <Font><Bold>true</Bold><Size>7</Size></Font>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>
   
       
            <Control xsi:type="EditControl" Id="wp">
                <Position Top="86" Left="20" Width="50" Heitght="11"/>
                <Attributes><NumbersOnly>true</NumbersOnly><WantReturn>true</WantReturn></Attributes>
            </Control>
            <Control xsi:type="StaticControl" Id="alpha">
                <Position Top="86" Left="73" Width="80" Height="10"/>
                <Caption>0 - 255</Caption>
                <Transparency>160</Transparency>
            </Control>
       
        </Controls>
    </Window>
</Interfaces>

Pretty sure its working bug free but it needs the .xml file to work aswell can that be removed?

This post was edited on 11-25-2009 at 10:41 AM by SourSpud.
11-25-2009 10:40 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Toast popup
As long as you remove all MsgPlus.CreateWnd functions that refer to it.

I did just write a quick script at work, it is as yet untested though:

js code:
var WM_CLOSE = 0x10; // Doesn't need to be defined, but it's just there to explain what it is

function OnEvent_Initialize(){ // On Script start
    if(Messenger.MyStatus > 1){ // If we are signed in
        OnEvent_SigninReady(Messenger.MyEmail); // Call the event OnEvent_SigninReady
    }
}

function OnEvent_SigninReady(){ // When we have signed in
    MsgPlus.AddTimer(Messenger.MyUserId, 100); // Start searching using a timer. Using Messenger.MyUserId as the timer's ID. Will be unique to the user, which is useful for checking it was added by the currently logged in user
}

function OnEvent_Timer(ID){ // When the timer fires
    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
    }
    MsgPlus.AddTimer(ID, 100); // Repeat the timer
}

function OnEvent_Uninitialize(){ // On script stopped
    MsgPlus.CancelTimer(Messenger.MyUserId); // Cancel outstanding timers
}

function OnEvent_Signout(){ // When we have signed out
    OnEvent_Uninitialize(); // Cancel outstanding timers
}
<Eljay> "Problems encountered: shit blew up" :zippy:
11-25-2009 10:53 AM
Profile PM Find Quote Report
SourSpud
Junior Member
**

Avatar
spud, spud, spud, spoon.

Posts: 58
35 / Male / Flag
Joined: Nov 2009
O.P. RE: Toast popup
thanks alot mate its working, and cheers for the comments in the code (Y)
11-25-2009 10:57 AM
Profile E-Mail PM Find Quote Report
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
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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