ok...this function is correct:
code:
function chatAttuale(){
var Windows = Messenger.CurrentChats;
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
var ChatWindow = e.item();
if ( ChatWindow.Handle == Interop.Call('user32', 'GetForegroundWindow' )) {
return ChatWindow
}
}
}
thank for all, bye!