Shoutbox

crash on closing chat window (WLM9) - 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: crash on closing chat window (WLM9) (/showthread.php?tid=88918)

crash on closing chat window (WLM9) by Suxsem on 02-02-2009 at 07:23 PM

Hi!
if I use this function on messenger 8.5 it's all OK

code:
var WM_CLOSE = 0x0010;
Interop.Call("user32", "SendMessageW", ChatWnd.Handle, WM_CLOSE, 0, 0);
but...if I use this on WLM 2009...
the chat window closes, but WLM non responding and I close it by task manager...
why? thank :)
RE: crash on closing chat window (WLM9) by matty on 02-02-2009 at 07:32 PM

Do you have Messenger Discovery Live installed? Closing the chat window like that shouldn't cause it to crash.


RE: crash on closing chat window (WLM9) by Suxsem on 02-02-2009 at 11:05 PM

no, I only have installed messenger plus 4.8...


RE: crash on closing chat window (WLM9) by matty on 02-03-2009 at 12:03 AM

Something REALLY weird is happening.

Mine isn't crashing HOWEVER the OnEvent_ChatWndCreated function is being called twice and the chat window is being opened twice and the handle of the window is obviously different. I wonder if WLM2009 tries to open it twice. Once to open and once to bring it forward?


RE: crash on closing chat window (WLM9) by Suxsem on 02-03-2009 at 12:07 PM

is probabily....
There are other ways to close the window?


RE: crash on closing chat window (WLM9) by Suxsem on 02-03-2009 at 12:24 PM

news!

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
if(Message=="ok"){
Interop.Call("user32", "SendMessageW", ChatWnd.Handle, 0x0111, 40003, 0);
}
}
=CRASH

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
if(Message=="ok"){
wnd = ChatWnd
MsgPlus.AddTimer("ok",2000)
return ""
}
}

function OnEvent_Timer(TimerId){
Interop.Call("user32", "SendMessageW", wnd.Handle, 0x0111, 40003, 0);
}
=WORK!

i think...the return is send before chat windows is closed... and that causes crash...
RE: crash on closing chat window (WLM9) by Mnjul on 02-03-2009 at 12:33 PM

Try PostMessage instead of SendMessage? Perhaps calling SendMessage within a Plus! event handler can cause unexpected troubles.


RE: crash on closing chat window (WLM9) by Suxsem on 02-03-2009 at 02:33 PM

emh...
can you tell me the exact code to try? :)
thank


RE: crash on closing chat window (WLM9) by Mnjul on 02-03-2009 at 02:45 PM

Just replace the SendMessage with PostMessage in your crash code:p

JScript code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
if(Message=="ok"){
Interop.Call("user32", "PostMessageW", ChatWnd.Handle, 0x0111, 40003, 0);
}
}


RE: crash on closing chat window (WLM9) by Suxsem on 02-03-2009 at 03:08 PM

o thank :)
i try it later with my PC :)


wow! it's work! thank!!!