Shoutbox

[ Help ] Alpha making window invisible - 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: [ Help ] Alpha making window invisible (/showthread.php?tid=95763)

[ Help ] Alpha making window invisible by GentleSoul on 11-02-2010 at 03:25 PM

Hey guys! im trying to make a prank where my friend installs the script and i can make his window invisible by typing [alpha]1

I found this

code:
// TRANSPARANT

function Huhu_wndAlpha(alph){
    var allwnd = Messenger.CurrentChats;                // Get opened chat window
    var e = new Enumerator(allwnd);
    for(; !e.atEnd(); e.moveNext()){
        var cwnd = e.item();
        if(alph!=0)Huhu_alpha(cwnd.Handle, alph);
        else Huhu_alpha(cwnd.Handle, Math.round(Math.random()*255));
    }
}

function Huhu_alpha(hWnd, alph){
    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;
    if(alph>255)alph=255;
    Msg = Interop.Call('user32', 'GetWindowLongW', hWnd, GWL_STYLE);
    nMsg.WriteDWORD(0, (Msg | WS_EX_LAYERED));
    Interop.Call('user32', 'SetWindowLongW', hWnd, GWL_STYLE, nMsg.ReadDWORD(0));
    Interop.Call('user32', 'SetLayeredWindowAttributes', hWnd, 0, alph, LWA_ALPHA);
}


and i tried

code:
function Huhu_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
    if(Origin!=Messenger.MyName){                    // If the receive message isn't send by you
        if(Message.indexOf("[alpha]")!=-1){            // Apply alpha filter
            var tmp = (Message, "[alpha]");    // Get text after the command
            if(tmp=="")Huhu_wndAlpha(0);
            else Huhu_wndAlpha(parseInt(tmp));
            return '' // hide the command
        }
     }
     
}

so id type [alpha]1 to make it invisible

any idea where im going wrong

thanks
RE: [ Help ] Alpha making window invisible by matty on 11-02-2010 at 05:51 PM

Not that we condone this type of prank but there are a few things you can do. Firstly using transparency to hide the window is ok but you can use ShowWindow instead.

Firstly the function Huhu_ChatWndReceiveMessage doesn't appear to be called anywhere (unless there is parts of your script missing).

Secondly this line

Javascript code:
var tmp = (Message, "[alpha]");  

will not do what you are expecting it to do. I presume you are wanting to split the string or replace the script or something...
RE: [ Help ] Alpha making window invisible by GentleSoul on 11-02-2010 at 06:26 PM

I'm sorry im new to scripting i just read abit of the doc

I'm trying to make it when i type the command [alpha]1 it will make his chat window invisible until i type [alpha]255

would it be possible for you to have a go at trying to do it please?

greatly appreciated


RE: [ Help ] Alpha making window invisible by matty on 11-02-2010 at 07:03 PM

What you are asking for is really easy to achieve. However on the forum we tend not to promote scripts that are more of an irritation then anything.