Shoutbox

[?] "WindowState" API - 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: [?] "WindowState" API (/showthread.php?tid=78007)

[?] "WindowState" API by roflmao456 on 10-06-2007 at 02:20 AM

is there like an API function that returns a window's state?

ie. 1 - Normal
2 - Maximized
3 - Minimized


RE: [?] "WindowState" API by phalanxii on 10-06-2007 at 02:28 AM

GetWindowPlacement

Create a DataBloc object (Interop.Allocate) for the WINDOWPLACEMENT structure.

code:
var WINDOWPLACEMENT = Interop.Allocate(44);
WINDOWPLACEMENT.WriteDWORD(0, WINDOWPLACEMENT.Size);
var Result = Interop.Call("User32", "GetWindowPlacement", Messenger.ContactListWndHandle, WINDOWPLACEMENT.DataPtr);
if(Result) Debug.Trace(WINDOWPLACEMENT.ReadDWORD(8));

RE: [?] "WindowState" API by roflmao456 on 10-06-2007 at 03:05 AM

works perfectly (Y):)