return NULL;
nsCOMPtr<nsIWindowMediator> windowMediator(do_GetService(kWindowMediatorCID)); ThrowErrIfNil(windowMediator, paramErr);  nsCOMPtr<nsISimpleEnumerator> windowEnumerator; if (NS_FAILED(windowMediator->GetXULWindowEnumerator(nsnull, getter_AddRefs(windowEnumerator)))) ThrowOSErr(paramErr);  WindowPtr windowPtr = NULL; PRBool more; windowEnumerator->HasMoreElements(&more); while (more) { nsCOMPtr<nsISupports> nextWindow = nsnull; windowEnumerator->GetNext(getter_AddRefs(nextWindow)); nsCOMPtr<nsIXULWindow> xulWindow(do_QueryInterface(nextWindow)); if (!xulWindow) break;  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(xulWindow)); ThrowErrIfNil(baseWindow, paramErr);  nsCOMPtr<nsIWidget> widget = nsnull; baseWindow->GetMainWidget(getter_AddRefs(widget)); ThrowErrIfNil(widget, paramErr);  WindowRef 	windowRef = (WindowRef)widget->GetNativeData(NS_NATIVE_DISPLAY); TWindowKind	thisWindowKind = GetXULWindowKind(xulWindow);   if (kAnyWindowKind == windowKind || (thisWindowKind == windowKind)) {  if (0L == --index) { windowPtr = (WindowPtr)windowRef; break; } }  windowEnumerator->HasMoreElements(&more); }  return windowPtr;
WindowPtr GetIndexedWindowOfKind(TWindowKind windowKind, TAEListIndex index){	//  write me	return NULL;}