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