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

Detecting things
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
O.P. Detecting things
Any way to detect when the main messenger window is minimized/maximised/closed? Thanks
11-29-2006 07:51 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: Detecting things
code:
Messenger.ContactListWndHandle

try using that? its in the scripting documentation

quote:
The Messenger::ContactListWndHandle property returns the window's handle of the contact list window, if currently opened.

Syntax


This is a read-only property.
[handle] ContactListWndHandle;

Data Type


If the contact list is closed, the return value is 0. The handle is a HWND object and must be used as is. It can be passed as parameter of various Windows API functions like SendMessage.

[quote]
Ultimatess6
: What a noob mod
11-29-2006 09:32 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: Detecting things
Note that only shows whether the window is open or closed, not minimized or maximized...
<Eljay> "Problems encountered: shit blew up" :zippy:
11-29-2006 10:14 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Detecting things
code:
var WindowPlacment = Interop.Allocate(48);

function OnEvent_Initialize(bMessengerStart){
    if (Messenger.ContactListWndHandle){
        _getPlacement(Messenger.ContactListWndHandle);
    }
}

function _getPlacement(hWnd){
    if (hWnd > 0){
        Interop.Call('user32', 'GetWindowPlacement', hWnd, WindowPlacement);
       
        Debug.Trace('> .showCmd : '+WindowPlacement.ReadDWORD(8));
        if (WindowPlacement.ReadDWORD(8) == 3){
            Debug.Trace(' > .showCmd : Maximized');
        } else if (WindowPlacement.ReadDWORD(8) == 2){
            Debug.Trace(' > .showCmd : Minimized');
        } else if (WindowPlacement.ReadDWORD(8) == 1){
            Debug.Trace(' > .showCmd : Opened');
        }
    } else {
        Debug.Trace(' > .showCmd : Closed');
    }
}

quote:
typedef struct _WINDOWPLACEMENT {
    UINT length;
    UINT flags;
    UINT showCmd;
    POINT ptMinPosition;
    POINT ptMaxPosition;
    RECT rcNormalPosition;
} WINDOWPLACEMENT;

This post was edited on 11-29-2006 at 10:47 PM by matty.
11-29-2006 10:32 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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