What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Silent Messages

Silent Messages
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: RE: Silent Messages
quote:
Originally posted by markee
The window does become activated but there is a problem that the chat window object isn't returned and hence why MrT's code is needed unfortunately.
?

The chat window object is returned though, MrT's code is not needed.
ChatWnd = Messenger.OpenChat("smarterchild@hotmail.com");

quote:
Syntax:
[object] OpenChat(
    [var] Contact
);

Return Value:
A ChatWnd object if the function succeeds or null if it fails.

However:
quote:
Originally posted by Felu
quote:
Originally posted by bigbob85
But isnt there a way to get the current window handle, send message,  then bring the original to the front?

code:
TopWnd = Interop.Call('User32', 'GetForegroundWindow');//Get the Active Window
ChatWnd = Messenger.OpenChat("smarterchild@hotmail.com");//Open the ChatWnd
ChatWnd.SendMessage("Testing");//Send the Message
Interop.Call("User32", "SendMessageW", ChatWnd.Handle, 274, 0xF020, null);//Minimize the ChatWnd
Interop.Call("User32", "BringWindowToTop", TopWnd);//Get the Active Window _BEFORE_ Sending the message on top



When you minimize the chat window again, the window that was on top before will already become the activated/top window again.

So this is not needed either:
    TopWnd = Interop.Call('User32', 'GetForegroundWindow');
and
    Interop.Call("User32", "BringWindowToTop", TopWnd);

This is all you need:
code:
var ChatWnd = Messenger.OpenChat("smarterchild@hotmail.com");//Open the ChatWnd
ChatWnd.SendMessage("Testing");//Send the Message
Interop.Call("User32", "SendMessageW", ChatWnd.Handle, 274, 0xF020, null);//Minimize the ChatWnd
provided the email is valid and a message can be send, so better add if (ChatWnd.EditChangeAllowed) {} too...

This post was edited on 01-18-2007 at 04:21 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-18-2007 03:53 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Silent Messages - by bigbob85 on 01-15-2007 at 10:06 AM
RE: Silent Messages - by Felu on 01-15-2007 at 10:48 AM
RE: Silent Messages - by bigbob85 on 01-15-2007 at 11:11 AM
RE: Silent Messages - by Plik on 01-15-2007 at 11:19 AM
RE: Silent Messages - by bigbob85 on 01-16-2007 at 10:01 AM
RE: Silent Messages - by Felu on 01-16-2007 at 02:09 PM
RE: Silent Messages - by MrT on 01-17-2007 at 04:26 PM
RE: Silent Messages - by Eljay on 01-17-2007 at 04:29 PM
RE: RE: Silent Messages - by markee on 01-18-2007 at 12:26 AM
RE: RE: RE: Silent Messages - by CookieRevised on 01-18-2007 at 03:53 AM
RE: Silent Messages - by bigbob85 on 01-19-2007 at 12:31 AM
RE: RE: Silent Messages - by CookieRevised on 01-19-2007 at 02:07 PM
RE: Silent Messages - by bigbob85 on 01-19-2007 at 11:12 PM
RE: Silent Messages - by CookieRevised on 01-20-2007 at 03:20 AM
RE: Silent Messages - by bigbob85 on 01-20-2007 at 08:44 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On