I am developing the automation scripts for a web site using java selenium web driver.
But that web site is requesting for "Authentication required" (window) for two times.
I handled the first "Authentication required" window using modifying the URL like below
Whenever the browser got stucks at "Authentication required" window, then I will be
starting a small http server and opening a url, that opened url will type the username
and password in the "Authentication required" window ( i.e. I am triggering another
process through a url by creating handler for that url which will copy username and
password in the "Authentication Required" window)
You can use AutoIT to automate window dialogs and for your scenario, you can actually bring a particular window into focus as well.
Here is one reference, but there are lot of posts available on this topic.