in reply to Win32:: How to tell when Default browser url has loaded
See Selenium. It sounds like this might have some of the code that you want, if not a complete solution.
--MidLifeXis