Shoutbox

[Request] Automatically open a minimized chat window when someone signs in - 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: [Request] Automatically open a minimized chat window when someone signs in (/showthread.php?tid=84764)

[Request] Automatically open a minimized chat window when someone signs in by timothyholt506 on 07-10-2008 at 04:33 PM

Is it possible to automatically open a minimized chat window every time someone signs in?


RE: [Request] Automatically open a minimized chat window when someone signs in by SmokingCookie on 07-10-2008 at 05:11 PM

You mean like opening a chat window as soon as somebody signs in?


RE: [Request] Automatically open a minimized chat window when someone signs in by timothyholt506 on 07-10-2008 at 06:34 PM

Yes.


RE: [Request] Automatically open a minimized chat window when someone signs in by SmokingCookie on 07-10-2008 at 06:39 PM

That's quite simple:

code:
function OnEvent_ContactSignIn(cEmail) {
      Messenger.OpenChat(cEmail);
}


RE: [Request] Automatically open a minimized chat window when someone signs in by timothyholt506 on 07-11-2008 at 10:02 AM

That opens them in the foreground. How do I make it so it opens them minimized?


RE: [Request] Automatically open a minimized chat window when someone signs in by SmokingCookie on 07-11-2008 at 12:59 PM

I'm not sure if this works, but I think it should:

code:
var SC_MINIMIZE = 0xF020

function OnEvent_ContactSignin(cEmail) {
      pChatWnd = Messenger.OpenChat(cEmail);
      k = Interop.Call("User32.dll","SendMessageW",SC_MIIMIZE,pChatWnd.Handle);
      if(k == 0) {
            Debug.Trace(Interop.GetLastError());
      }
}


RE: [Request] Automatically open a minimized chat window when someone signs in by roflmao456 on 07-11-2008 at 04:00 PM

:P

code:
function OnEvent_ContactSignin(Email){
Interop.Call("user32","CloseWindow",Messenger.OpenChat(Email).handle);
}

tested and works

btw SmokingCookie your code doesn't work. (bad calling convention);shortened code thanks to matty's post  lol =p
RE: [Request] Automatically open a minimized chat window when someone signs in by matty on 07-12-2008 at 03:22 PM

These can all be shorted by doing

code:
function OnEvent_ContactSignin (sEmail) {
    Interop.Call( 'user32', 'ShowWindow', Messenger.OpenChat( sEmail ).Handle, 6 /* SW_MINIMIZE */ );
}