Shoutbox

How to close window - 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: How to close window (/showthread.php?tid=94286)

How to close window by zeroip on 04-02-2010 at 10:15 PM

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
{
var strMsg = Message;
if(strMsg.search('youtube.com')!=-1) {
strMsg = strMsg.split('youtube.com')[1];
strMsg = strMsg.split('?v=')[1];
var id = strMsg.split('&')[0];
if(id) {
var thumb_url = 'http://i1.ytimg.com/vi/'+id+'/1.jpg';
var MyWindow = MsgPlus.CreateWnd("Windows.xml", "WndAsk");
}
}
}

function OnWndAskEvent_CtrlClicked(PlusWnd, ControlId) {
    if (ControlId == "Link") {

var MyWindow = MsgPlus.CreateWnd("Windows.xml", "WndVideo");
var WebControl = MyWindow.Browser_GetInterface("BroInternet");
WebControl.Navigate2("http://www.youtube.com/watch_popup?v=");
    }
}

How I can close the Window: WndAsk if function OnWndAskEvent_CtrlClicked is activ?
RE: How to close window by roflmao456 on 04-02-2010 at 10:38 PM

put the WndAsk CreateWnd function into a global variable and then use the Close function with that global variable :P

code:
var window;

function func1(){
window = MsgPlus.CreateWnd("windows.xml", "somewindow");
}

function func2(){
window.Close(0);
}

...or use the PlusWnd object (didn't see that LOL)

code:
PlusWnd.Close(0);


RE: How to close window by zeroip on 04-03-2010 at 05:25 PM

Oh thank you =) with PlusWnd.Close() it didnt work but with PlusWnd.Close(0) it do! thx