What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » function OnGetScriptMenu - ChatWnd

function OnGetScriptMenu - ChatWnd
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: function OnGetScriptMenu - ChatWnd
Just use the Win32 API GetForegroundWindow this will return the handle of the window then you can iterate through the current open chat windows to get the Plus! ChatWnd object.

code:
for ( var oChatWnd = new Enumerator( Messenger.CurrentChats ); !oChatWnd.atEnd(); oChatWnd.moveNext() ) {
    if ( oChatWnd.item().Handle === Interop.Call( 'user32', 'GetForegroundWindow' ) {
        return oChatWnd.item();
    }
}

This post was edited on 07-08-2008 at 01:14 PM by matty.
07-07-2008 04:08 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
function OnGetScriptMenu - ChatWnd - by Suxsem on 07-07-2008 at 12:12 PM
RE: function OnGetScriptMenu - ChatWnd - by Matti on 07-07-2008 at 12:17 PM
RE: function OnGetScriptMenu - ChatWnd - by Suxsem on 07-07-2008 at 12:20 PM
RE: function OnGetScriptMenu - ChatWnd - by matty on 07-07-2008 at 04:08 PM
RE: function OnGetScriptMenu - ChatWnd - by Suxsem on 07-08-2008 at 11:09 AM
RE: function OnGetScriptMenu - ChatWnd - by Matti on 07-08-2008 at 11:39 AM
RE: function OnGetScriptMenu - ChatWnd - by Suxsem on 07-08-2008 at 11:41 AM
RE: function OnGetScriptMenu - ChatWnd - by matty on 07-08-2008 at 01:13 PM


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