matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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.
|
|