Shoutbox

Detect Minimized Window? - 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: Detect Minimized Window? (/showthread.php?tid=95251)

Detect Minimized Window? by macgyver08 on 08-14-2010 at 07:13 PM

Is there a way to detect if a chat window is minimized and/or out of focus?


RE: Detect Minimized Window? by roflmao456 on 08-14-2010 at 11:11 PM

JScript code:
if(Interop.Call("user32", "GetForegroundWindow") == ChatWnd.Handle){
// chatwnd is focused
} else {
// chatwnd is not focused
}


(not tested but should work) :P
RE: RE: Detect Minimized Window? by macgyver08 on 08-15-2010 at 02:30 AM

quote:
Originally posted by roflmao456
JScript code:
if(Interop.Call("user32", "GetForegroundWindow") == ChatWnd.Handle){
// chatwnd is focused
} else {
// chatwnd is not focused
}


(not tested but should work) :P

Thanks a lot!

I was confused at first, cause I replaced "user32" (with quotes) to the parameter "Origin" (without quotes), thinking user32 was the generic term you threw in there for any random person's chat window. But I googled it and found others using "user32.dll", so I used that, and it works! I don't know if only "user32" would've worked, I didn't try it lol.

anyway, thanks for helping me! :)
RE: Detect Minimized Window? by matty on 08-15-2010 at 02:51 AM

User32.dll is the Dynamic Link Library (which is apart of windows) where the function GetForegroundWindow is found. There are others like kernel32.dll, gdi.dll etc. But each DLL has different exported functions you can use.