C
Charles
Is there a way to detect if a window is out of focus?
Here's what I need it for: I have a web-based chat application that one
of the 2 people chatting may have the chat window open or minimized.
When the chat window is open, probably it's because the person is
reading the other person's messages or because he/she is typing a
message. When the chat window is minimized it's probably because none
of the guys have chatted over the last minutes, and probably because no
one is typing.
Now, if some one sends a message to the other guy, I want the
recipient's minimized window to blink in his task bar so that he knows
he's got a new message. To do this, I would remotely ask to give focus
to his window. But if by chance the recipient is typing a message, his
window isn't out of focus, and if I ask to give focus to his window,
his textarea where he's writing will lose focus, and he won't be able
to type anymore until he manually gives focus again to the textarea
where he was typing.
Do you get the picture? How do I know if a window is out of focus?
Thanks,
Here's what I need it for: I have a web-based chat application that one
of the 2 people chatting may have the chat window open or minimized.
When the chat window is open, probably it's because the person is
reading the other person's messages or because he/she is typing a
message. When the chat window is minimized it's probably because none
of the guys have chatted over the last minutes, and probably because no
one is typing.
Now, if some one sends a message to the other guy, I want the
recipient's minimized window to blink in his task bar so that he knows
he's got a new message. To do this, I would remotely ask to give focus
to his window. But if by chance the recipient is typing a message, his
window isn't out of focus, and if I ask to give focus to his window,
his textarea where he's writing will lose focus, and he won't be able
to type anymore until he manually gives focus again to the textarea
where he was typing.
Do you get the picture? How do I know if a window is out of focus?
Thanks,