} else if ((aEvent->message == NS_DESTROY) && (gShellInstance->GetApplicationWidget() == aEvent->widget)) { ::PostQuitMessage(0);
nsEventStatus PR_CALLBACK HandleEventApplication(nsGUIEvent *aEvent){  /*   * If this is a menu selection, generate a command object and   * dispatch it to the target object   */  if (aEvent->message == NS_MENU_SELECTED)  {    nsIWebViewerContainer * viewer;    nsresult res = gShellInstance->GetApplicationShell()->GetWebViewerContainer(&viewer);    if (res == NS_OK)    {      nsMenuEvent * event = (nsMenuEvent *) aEvent;      nsIMenuManager * menumgr = viewer->GetMenuManager();      nsIXPFCMenuItem * item = menumgr->MenuItemFromID(event->mCommand);      item->SendCommand();      NS_RELEASE(viewer);      return nsEventStatus_eIgnore;     }      }  return (gShellInstance->GetApplicationShell()->HandleEvent(aEvent));}