nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(sWatcherServiceContractID));
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
static nsresult InitializeWindowCreator(){  // create an nsWindowCreator and give it to the WindowWatcher service  nsWindowCreator *creatorCallback = new nsWindowCreator();  if (!creatorCallback)    return NS_ERROR_OUT_OF_MEMORY;  nsCOMPtr<nsIWindowCreator> windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback));  if (windowCreator) {    nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(sWatcherServiceContractID));    if (wwatch) {      wwatch->SetWindowCreator(windowCreator);      return NS_OK;    }  }  return NS_ERROR_FAILURE;}