Forum Moderators: open
Usually the window would have focus when a page loads (unless the load happened via some scripting) so you could just set a variable (isactive) to false in the onblur event and true in the onfocus event... (any child elements [input, iframe etc] of the body would need to set the variable to true when they steal focus)
But why on earth do you need to know this?
Then it'll depend upon the language your using for development and the OS you're working with. Each programming language ties into the OS through a set of APIs so you'll need to learn what those APIs are, the command sets they offer, and the syntax of the development language you're using to work with them.
i do wanna check it for my chatroom, when it's active, higlihght will not beep, if it's inactive, highlight will generate a beep
Seems like a good usage (providing you can turn it off ;)), however, I'm afraid my bet is that it can't be done.
You might want to look into activeElement and various other IE properties at MSDN.
Best of luck and if you nail it be sure to let us know.
Josh