nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
nsresult InitializeWindowCreator(){    // create an nsWindowCreator and give it to the WindowWatcher service    WindowCreator *creatorCallback = new WindowCreator();    if (creatorCallback)    {        nsCOMPtr<nsIWindowCreator> windowCreator(dont_QueryInterface(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback)));        if (windowCreator)        {            nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));            if (wwatch)            {                wwatch->SetWindowCreator(windowCreator);                return NS_OK;            }        }    }    return NS_ERROR_FAILURE;}