quote:
Of course the code can always be shorted like this:
code:
function CheckWindow(){
return Interop.Call('user32', 'GetForegroundWindow') === pPlusWnd.Handle ? true : false ;
}
The expression used in the tenary check already returns true or false, therefore no need for putting it into a tenary check in the first place.
(and parameter pPlusWnd is missing)
=>>>>
code:
function CheckWindow(pPlusWnd){
return Interop.Call('user32', 'GetForegroundWindow') === pPlusWnd.Handle;
}
![;)](images/smilies/msn_wink.gif)