Index: include/reactos/undocuser.h
===================================================================
--- include/reactos/undocuser.h	(revision 68619)
+++ include/reactos/undocuser.h	(working copy)
@@ -60,6 +60,9 @@
 #define DCX_KEEPLAYOUT   0x40000000
 #define DCX_PROCESSOWNED 0x80000000
 
+/* Non SDK TPM types.*/
+#define TPM_SYSTEM_MENU  0x00000200
+
 /* NtUserCreateWindowEx dwFlags bits. */
 #define NUCWE_ANSI       0x00000001
 #define NUCWE_SIDEBYSIDE 0x40000000
Index: win32ss/user/ntuser/menu.c
===================================================================
--- win32ss/user/ntuser/menu.c	(revision 68619)
+++ win32ss/user/ntuser/menu.c	(working copy)
@@ -620,6 +620,7 @@
 BOOL FASTCALL
 IntSetMenuFlagRtoL(PMENU Menu)
 {
+   ERR("SetMenuFlagRtoL\n");
    Menu->fFlags |= MNF_RTOL;
    return TRUE;
 }
@@ -705,6 +706,12 @@
       Menu->TimeToHide = lpmi->TimeToHide;
       Menu->hWnd = lpmi->Wnd;
    }
+   if ( lpmi->fMask & MIM_STYLE)
+   {
+      if (lpmi->dwStyle & MNS_AUTODISMISS) FIXME("MNS_AUTODISMISS unimplemented wine\n");
+      if (lpmi->dwStyle & MNS_DRAGDROP)    FIXME("MNS_DRAGDROP unimplemented wine\n");
+      if (lpmi->dwStyle & MNS_MODELESS)    FIXME("MNS_MODELESS unimplemented wine\n");
+   }
    return TRUE;
 }
 
@@ -971,8 +978,16 @@
    MenuItem->fState ^= (res ^ uEnable) & (MF_GRAYED | MF_DISABLED);
 
    /* If the close item in the system menu change update the close button */
-   if((MenuItem->wID == SC_CLOSE) && (res != uEnable))
+   if (res != uEnable)
    {
+      switch (MenuItem->wID) // More than just close.
+      {
+        case SC_CLOSE:
+        case SC_MAXIMIZE:
+        case SC_MINIMIZE:
+        case SC_MOVE:
+        case SC_RESTORE:
+        case SC_SIZE:
 	if (MenuObject->fFlags & MNF_SYSSUBMENU && MenuObject->spwndNotify != 0)
 	{
             RECTL rc = MenuObject->spwndNotify->rcWindow;
@@ -982,6 +997,9 @@
             rc.bottom = 0;
             co_UserRedrawWindow(MenuObject->spwndNotify, &rc, 0, RDW_FRAME | RDW_INVALIDATE | RDW_NOCHILDREN);
 	}
+	default:
+           break;
+      }
    }
    return res;
 }
@@ -1822,7 +1840,78 @@
    return TRUE;
 }
 
+BOOL FASTCALL
+IntSetMenu(
+   PWND Wnd,
+   HMENU Menu,
+   BOOL *Changed)
+{
+   PMENU OldMenu, NewMenu = NULL;
 
+   if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
+   {
+      ERR("SetMenu: Invalid handle 0x%p!\n",UserHMGetHandle(Wnd));
+      EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
+      return FALSE;
+   }
+
+   *Changed = (Wnd->IDMenu != (UINT) Menu);
+   if (! *Changed)
+   {
+      return TRUE;
+   }
+
+   if (Wnd->IDMenu)
+   {
+      OldMenu = IntGetMenuObject((HMENU) Wnd->IDMenu);
+      ASSERT(NULL == OldMenu || OldMenu->hWnd == Wnd->head.h);
+   }
+   else
+   {
+      OldMenu = NULL;
+   }
+
+   if (NULL != Menu)
+   {
+      NewMenu = IntGetMenuObject(Menu);
+      if (NULL == NewMenu)
+      {
+         if (NULL != OldMenu)
+         {
+            IntReleaseMenuObject(OldMenu);
+         }
+         EngSetLastError(ERROR_INVALID_MENU_HANDLE);
+         return FALSE;
+      }
+      if (NULL != NewMenu->hWnd)
+      {
+         /* Can't use the same menu for two windows */
+         if (NULL != OldMenu)
+         {
+            IntReleaseMenuObject(OldMenu);
+         }
+         EngSetLastError(ERROR_INVALID_MENU_HANDLE);
+         return FALSE;
+      }
+
+   }
+
+   Wnd->IDMenu = (UINT) Menu;
+   if (NULL != NewMenu)
+   {
+      NewMenu->hWnd = Wnd->head.h;
+      IntReleaseMenuObject(NewMenu);
+   }
+   if (NULL != OldMenu)
+   {
+      OldMenu->hWnd = NULL;
+      IntReleaseMenuObject(OldMenu);
+   }
+
+   return TRUE;
+}
+
+
 /* FUNCTIONS *****************************************************************/
 
 /*
@@ -2142,6 +2231,7 @@
    HMENU hMenu;
    MENUBARINFO kmbi;
    BOOL Ret;
+   PPOPUPMENU pPopupMenu;
    NTSTATUS Status = STATUS_SUCCESS;
    PMENU Menu = NULL;
    DECLARE_RETURN(BOOL);
@@ -2226,7 +2316,13 @@
    kmbi.hwndMenu = NULL;
    kmbi.fBarFocused = FALSE;
    kmbi.fFocused = FALSE;
-   //kmbi.fBarFocused = top_popup_hmenu == hMenu;
+
+   pPopupMenu = ((PMENUWND)pWnd)->ppopupmenu;
+   if (pPopupMenu)
+   {
+      //kmbi.fBarFocused = pPopupMenu->spmenu == Menu;
+   }
+
    if (idItem)
    {
        kmbi.fFocused = Menu->iItem == idItem-1;
@@ -2238,8 +2334,8 @@
 /*   else
    {
        kmbi.fFocused = kmbi.fBarFocused;
-   }
-*/
+   }*/
+
    _SEH2_TRY
    {
       RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO));
@@ -2509,6 +2605,49 @@
  * @implemented
  */
 BOOL APIENTRY
+NtUserSetMenu(
+   HWND hWnd,
+   HMENU Menu,
+   BOOL Repaint)
+{
+   PWND Window;
+   BOOL Changed;
+   DECLARE_RETURN(BOOL);
+
+   TRACE("Enter NtUserSetMenu\n");
+   UserEnterExclusive();
+
+   if (!(Window = UserGetWindowObject(hWnd)))
+   {
+      RETURN( FALSE);
+   }
+
+   if (! IntSetMenu(Window, Menu, &Changed))
+   {
+      RETURN( FALSE);
+   }
+
+   // Not minimized and please repaint!!!
+   if (!(Window->style & WS_MINIMIZE) && (Repaint || Changed))
+   {
+      USER_REFERENCE_ENTRY Ref;
+      UserRefObjectCo(Window, &Ref);
+      co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
+      UserDerefObjectCo(Window);
+   }
+
+   RETURN( TRUE);
+
+CLEANUP:
+   TRACE("Leave NtUserSetMenu, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL APIENTRY
 NtUserSetMenuContextHelpId(
    HMENU hMenu,
    DWORD dwContextHelpId)
Index: win32ss/user/ntuser/menu.h
===================================================================
--- win32ss/user/ntuser/menu.h	(revision 68619)
+++ win32ss/user/ntuser/menu.h	(working copy)
@@ -10,6 +10,55 @@
 #define MF_END             (0x0080)
 #endif
 
+typedef struct tagMENUSTATE
+{
+  PPOPUPMENU  pGlobalPopupMenu;
+  struct
+  {
+  ULONG       fMenuStarted:1;
+  ULONG       fIsSysMenu:1;
+  ULONG       fInsideMenuLoop:1;
+  ULONG       fButtonDown:1;
+  ULONG       fInEndMenu:1;
+  ULONG       fUnderline:1;
+  ULONG       fButtonAlwaysDown:1;
+  ULONG       fDragging:1;
+  ULONG       fModelessMenu:1;
+  ULONG       fInCallHandleMenuMessages:1;
+  ULONG       fDragAndDrop:1;
+  ULONG       fAutoDismiss:1;
+  ULONG       fAboutToAutoDismiss:1;
+  ULONG       fIgnoreButtonUp:1;
+  ULONG       fMouseOffMenu:1;
+  ULONG       fInDoDragDrop:1;
+  ULONG       fActiveNoForeground:1;
+  ULONG       fNotifyByPos:1;
+  ULONG       fSetCapture:1;
+  ULONG       iAniDropDir:5;
+  };
+  POINT       ptMouseLast; 
+  INT         mnFocus;
+  INT         cmdLast;
+  PTHREADINFO ptiMenuStateOwner;
+  DWORD       dwLockCount;
+  struct tagMENUSTATE* pmnsPrev;
+  POINT       ptButtonDown;
+  ULONG_PTR   uButtonDownHitArea;
+  UINT        uButtonDownIndex;
+  INT         vkButtonDown;
+  ULONG_PTR   uDraggingHitArea;
+  UINT        uDraggingIndex;
+  UINT        uDraggingFlags;
+  HDC         hdcWndAni;
+  DWORD       dwAniStartTime;
+  INT         ixAni;
+  INT         iyAni;
+  INT         cxAni;
+  INT         cyAni;
+  HBITMAP     hbmAni;
+  HDC         hdcAni;
+} MENUSTATE, *PMENUSTATE;
+
 typedef struct _SETMENUITEMRECT
 {
   UINT uItem;
@@ -51,3 +100,4 @@
 BOOL FASTCALL IntRemoveMenuItem(PMENU Menu, UINT uPosition, UINT uFlags, BOOL bRecurse);
 PITEM FASTCALL MENU_FindItem( PMENU *pmenu, UINT *nPos, UINT wFlags );
 BOOL FASTCALL IntMenuItemInfo(PMENU Menu, UINT Item, BOOL ByPosition, PROSMENUITEMINFO UnsafeItemInfo, BOOL SetOrGet, PUNICODE_STRING lpstr);
+BOOL FASTCALL IntSetMenu(PWND Wnd,HMENU Menu,BOOL *Changed);
Index: win32ss/user/ntuser/window.c
===================================================================
--- win32ss/user/ntuser/window.c	(revision 68619)
+++ win32ss/user/ntuser/window.c	(working copy)
@@ -794,78 +794,7 @@
    return Ret;
 }
 
-static BOOL FASTCALL
-IntSetMenu(
-   PWND Wnd,
-   HMENU Menu,
-   BOOL *Changed)
-{
-   PMENU OldMenu, NewMenu = NULL;
 
-   if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
-   {
-      ERR("SetMenu: Invalid handle 0x%p!\n",UserHMGetHandle(Wnd));
-      EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
-      return FALSE;
-   }
-
-   *Changed = (Wnd->IDMenu != (UINT) Menu);
-   if (! *Changed)
-   {
-      return TRUE;
-   }
-
-   if (Wnd->IDMenu)
-   {
-      OldMenu = IntGetMenuObject((HMENU) Wnd->IDMenu);
-      ASSERT(NULL == OldMenu || OldMenu->hWnd == Wnd->head.h);
-   }
-   else
-   {
-      OldMenu = NULL;
-   }
-
-   if (NULL != Menu)
-   {
-      NewMenu = IntGetMenuObject(Menu);
-      if (NULL == NewMenu)
-      {
-         if (NULL != OldMenu)
-         {
-            IntReleaseMenuObject(OldMenu);
-         }
-         EngSetLastError(ERROR_INVALID_MENU_HANDLE);
-         return FALSE;
-      }
-      if (NULL != NewMenu->hWnd)
-      {
-         /* Can't use the same menu for two windows */
-         if (NULL != OldMenu)
-         {
-            IntReleaseMenuObject(OldMenu);
-         }
-         EngSetLastError(ERROR_INVALID_MENU_HANDLE);
-         return FALSE;
-      }
-
-   }
-
-   Wnd->IDMenu = (UINT) Menu;
-   if (NULL != NewMenu)
-   {
-      NewMenu->hWnd = Wnd->head.h;
-      IntReleaseMenuObject(NewMenu);
-   }
-   if (NULL != OldMenu)
-   {
-      OldMenu->hWnd = NULL;
-      IntReleaseMenuObject(OldMenu);
-   }
-
-   return TRUE;
-}
-
-
 /* INTERNAL ******************************************************************/
 
 ////
@@ -3943,51 +3872,6 @@
  * @implemented
  */
 BOOL APIENTRY
-NtUserSetMenu(
-   HWND hWnd,
-   HMENU Menu,
-   BOOL Repaint)
-{
-   PWND Window;
-   BOOL Changed;
-   DECLARE_RETURN(BOOL);
-
-   TRACE("Enter NtUserSetMenu\n");
-   UserEnterExclusive();
-
-   if (!(Window = UserGetWindowObject(hWnd)))
-   {
-      RETURN( FALSE);
-   }
-
-   if (! IntSetMenu(Window, Menu, &Changed))
-   {
-      RETURN( FALSE);
-   }
-
-   if (Changed && Repaint)
-   {
-      USER_REFERENCE_ENTRY Ref;
-
-      UserRefObjectCo(Window, &Ref);
-      co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
-                            SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
-
-      UserDerefObjectCo(Window);
-   }
-
-   RETURN( TRUE);
-
-CLEANUP:
-   TRACE("Leave NtUserSetMenu, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
-}
-
-/*
- * @implemented
- */
-BOOL APIENTRY
 NtUserSetWindowFNID(HWND hWnd,
                     WORD fnID)
 {
Index: win32ss/user/user32/windows/defwnd.c
===================================================================
--- win32ss/user/user32/windows/defwnd.c	(revision 68619)
+++ win32ss/user/user32/windows/defwnd.c	(working copy)
@@ -253,11 +253,12 @@
       case SC_CLOSE:
         return SendMessageW(hWnd, WM_CLOSE, 0, 0);
 
-//      case SC_DEFAULT:
+      case SC_DEFAULT:
       case SC_MOUSEMENU:
         {
           Pt.x = (short)LOWORD(lParam);
           Pt.y = (short)HIWORD(lParam);
+          TRACE("SC_MOUSEMENU Default %d\n",(BOOL)( (wParam& 0xfff0)== SC_DEFAULT) );
           MenuTrackMouseMenuBar(hWnd, wParam & 0x000f, Pt);
         }
 	break;
@@ -566,7 +567,7 @@
             HMENU menu = GetSystemMenu(hWnd, FALSE);
 
             if (menu)
-                TrackPopupMenu(menu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
+                TrackPopupMenu(menu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_SYSTEM_MENU,
                                LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
             return 0;
         }
@@ -678,11 +679,15 @@
                         Flags = TPM_LEFTBUTTON | TPM_RIGHTBUTTON;
                       else
                         Flags = TPM_LEFTBUTTON;
-
-                      TrackPopupMenu(SystemMenu, Flags,
-                                     Pt.x, Pt.y, 0, hWnd, NULL);
+ 
+                      TrackPopupMenu(SystemMenu, Flags|TPM_SYSTEM_MENU,
+                                      Pt.x, Pt.y, 0, hWnd, NULL);
                     }
                 }
+                if (HitCode == HTHSCROLL || HitCode == HTVSCROLL)
+                {
+                   WARN("Scroll Menu Not Supported\n");
+                }
 	    }
             break;
         }
Index: win32ss/user/user32/windows/menu.c
===================================================================
--- win32ss/user/user32/windows/menu.c	(revision 68619)
+++ win32ss/user/user32/windows/menu.c	(working copy)
@@ -1773,9 +1773,9 @@
          * FIXME:
          * Custom checkmark bitmaps are monochrome but not always 1bpp.
          */
-        if( !(MenuInfo->dwStyle & MNS_NOCHECK)) {
-            bm = (lpitem->fState & MF_CHECKED) ? lpitem->hbmpChecked : 
-                lpitem->hbmpUnchecked;
+        if( !(MenuInfo->dwStyle & MNS_NOCHECK))
+        {
+            bm = (lpitem->fState & MF_CHECKED) ? lpitem->hbmpChecked :  lpitem->hbmpUnchecked;
             if (bm)  /* we have a custom bitmap */
             {
                 HDC hdcMem = CreateCompatibleDC( hdc );
@@ -1805,7 +1805,7 @@
                 checked = TRUE;
             }
         }
-        if ( lpitem->hbmpItem )//&& !( checked && (MenuInfo->dwStyle & MNS_CHECKORBMP)))
+        if ( lpitem->hbmpItem && !( checked && (MenuInfo->dwStyle & MNS_CHECKORBMP)))
         {
             RECT bmpRect;
             CopyRect(&bmpRect, &rect);
@@ -2037,6 +2037,8 @@
  */
 static BOOL MENU_InitPopup( HWND hwndOwner, HMENU hmenu, UINT flags )
 {
+    PWND pWndOwner, pWndCreated;
+    PPOPUPMENU pPopupMenu;
     MENU *menu;
     DWORD ex_style = WS_EX_TOOLWINDOW;
     ROSMENUINFO MenuInfo;
@@ -2052,20 +2054,50 @@
         return FALSE;
     }
     MenuGetRosMenuInfo(&MenuInfo, menu->head.h);
+    pWndOwner = ValidateHwndNoErr(hwndOwner);
     //menu->hwndOwner = hwndOwner;
-    MenuInfo.spwndNotify = ValidateHwndNoErr( hwndOwner );
+    MenuInfo.spwndNotify = pWndOwner; //???
 
-    if (flags & TPM_LAYOUTRTL)
-        ex_style = WS_EX_LAYOUTRTL;
+    if (flags & TPM_LAYOUTRTL || pWndOwner->ExStyle & WS_EX_LAYOUTRTL)
+       ex_style = WS_EX_LAYOUTRTL;
 
     /* NOTE: In Windows, top menu popup is not owned. */
     //menu->hWnd = CreateWindowExW( ex_style, WC_MENU, NULL,
     MenuInfo.Wnd = CreateWindowExW( ex_style, WC_MENU, NULL,
                                 WS_POPUP, 0, 0, 0, 0,
-                                hwndOwner, 0, (HINSTANCE)GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE),
+                                hwndOwner, 0, pWndOwner->hModule,
                                 (LPVOID)hmenu );
+
     MenuSetRosMenuInfo(&MenuInfo);
     if( !menu->hWnd ) return FALSE;
+
+    //
+    //  Setup pop up menu structure.
+    //
+    pWndCreated = ValidateHwndNoErr(MenuInfo.Wnd);
+
+    pPopupMenu = ((PMENUWND)pWndCreated)->ppopupmenu;
+    pPopupMenu->spwndActivePopup = pWndCreated; // top_popup = MenuInfo.Wnd or menu->hWnd
+    pPopupMenu->spwndNotify = pWndOwner;        // Same as MenuInfo.spwndNotify(which could be wrong) or menu->hwndOwner
+    pPopupMenu->spmenu = menu;                  // top_popup_hmenu = hMenu
+
+    pPopupMenu->fIsTrackPopup = TRUE;
+    pPopupMenu->fIsSysMenu    = !!(flags & TPM_SYSTEM_MENU);
+    pPopupMenu->fNoNotify     = !!(flags & TPM_NONOTIFY);
+    pPopupMenu->fRightButton  = !!(flags & TPM_RIGHTBUTTON);
+    pPopupMenu->fSynchronous  = !!(flags & TPM_RETURNCMD);
+
+    if (pPopupMenu->fRightButton)
+       pPopupMenu->fFirstClick = !!(GetKeyState(VK_RBUTTON) & 0x8000);
+    else
+       pPopupMenu->fFirstClick = !!(GetKeyState(VK_LBUTTON) & 0x8000);
+
+    if (gpsi->aiSysMet[SM_MENUDROPALIGNMENT] ||
+        menu->fFlags & MNF_RTOL)
+    {
+       pPopupMenu->fDroppedLeft = TRUE;
+    }
+
     return TRUE;
 }
 
@@ -2214,7 +2246,7 @@
     ROSMENUINFO TopMenuInfo;
     HDC hdc;
 
-    TRACE("owner=%p menu=%p index=0x%04x select=0x%04x\n", hwndOwner, hmenu, wIndex, sendMenuSelect);
+    ERR("owner=%p menu=%p index=0x%04x select=0x%04x\n", hwndOwner, hmenu, wIndex, sendMenuSelect);
 
     if (!hmenu || !hmenu->cItems || !hmenu->Wnd) return;
     if (hmenu->iItem == wIndex) return;
@@ -2237,6 +2269,7 @@
             ItemInfo.fMask |= MIIM_STATE;
             ItemInfo.fState &= ~(MF_HILITE|MF_MOUSESELECT);
             MenuSetRosMenuItemInfo(hmenu->Self, hmenu->iItem, &ItemInfo);
+            ERR("Select off\n");
         }
         MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, &ItemInfo,
                        hmenu->cyMenu, !(hmenu->fFlags & MNF_POPUP),
@@ -2255,6 +2288,7 @@
                 ItemInfo.fMask |= MIIM_STATE;
                 ItemInfo.fState |= MF_HILITE;
                 MenuSetRosMenuItemInfo(hmenu->Self, hmenu->iItem, &ItemInfo);
+                ERR("Select on\n");
                 MENU_EnsureMenuItemVisible(hmenu, &ItemInfo, hdc);
                 MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc,
                                &ItemInfo, hmenu->cyMenu, !(hmenu->fFlags & MNF_POPUP), ODA_SELECT);
@@ -2358,11 +2392,9 @@
   MenuCleanupRosMenuItemInfo(&ItemInfo);
 }
 
-#if 0
 LRESULT WINAPI
 PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
-#ifdef __REACTOS__ // Do this now, remove after Server side is fixed.
   PWND pWnd;
   PPOPUPMENU pPopupMenu;
 
@@ -2378,7 +2410,9 @@
         NtUserSetWindowFNID(Wnd, FNID_MENU);
         pPopupMenu = HeapAlloc( GetProcessHeap(), 0, sizeof(POPUPMENU) );
         pPopupMenu->spwndPopupMenu = pWnd;
+        pPopupMenu->posSelectedItem = NO_SELECTED_ITEM;
         SetWindowLongPtrW(Wnd, 0, (LONG_PTR)pPopupMenu);
+        ERR("Pop Up Menu is Setup! Msg %d\n",Message);
      }
      else
      {
@@ -2390,7 +2424,6 @@
         pPopupMenu = ((PMENUWND)pWnd)->ppopupmenu;
      }
   }
-#endif    
 
   TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam);
 
@@ -2438,23 +2471,10 @@
       HeapFree( GetProcessHeap(), 0, pPopupMenu );
       SetWindowLongPtrW(Wnd, 0, 0);
       NtUserSetWindowFNID(Wnd, FNID_DESTROY);
+      ERR("Pop Up Menu is GONE!\n");
       break;
       }
 
-    case WM_SHOWWINDOW:
-      if (0 != wParam)
-      {
-          if (!pPopupMenu || !pPopupMenu->spmenu)
-          {
-              OutputDebugStringA("no menu to display\n");
-          }
-      }
-      /*else
-      {
-          pPopupMenu->spmenu = NULL; ///// WTF?
-      }*/
-      break;
-
     case MM_SETMENUHANDLE:
       {
         PMENU pmenu = ValidateHandle((HMENU)wParam, TYPE_MENU);
@@ -2477,113 +2497,7 @@
 
   return 0;
 }
-#endif
 
-LRESULT WINAPI
-PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam)
-{
-#ifdef __REACTOS__ // Do this now, remove after Server side is fixed.
-  PWND pWnd;
-
-  pWnd = ValidateHwnd(Wnd);
-  if (pWnd)
-  {
-     if (!pWnd->fnid)
-     {
-        if (Message != WM_NCCREATE)
-        {
-           return DefWindowProcW(Wnd, Message, wParam, lParam);
-        }
-        NtUserSetWindowFNID(Wnd, FNID_MENU);
-     }
-     else
-     {
-        if (pWnd->fnid != FNID_MENU)
-        {
-           ERR("Wrong window class for Menu!\n");
-           return 0;
-        }
-     }
-  }
-#endif    
-
-  TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam);
-
-  switch(Message)
-    {
-    case WM_CREATE:
-      {
-        CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam;
-        SetWindowLongPtrW(Wnd, 0, (LONG_PTR)cs->lpCreateParams);
-        return 0;
-      }
-
-    case WM_MOUSEACTIVATE:  /* We don't want to be activated */
-      return MA_NOACTIVATE;
-
-    case WM_PAINT:
-      {
-        PAINTSTRUCT ps;
-        BeginPaint(Wnd, &ps);
-        MenuDrawPopupMenu(Wnd, ps.hdc, (HMENU)GetWindowLongPtrW(Wnd, 0));
-        EndPaint(Wnd, &ps);
-        return 0;
-      }
-
-    case WM_PRINTCLIENT:
-      {
-         MenuDrawPopupMenu( Wnd, (HDC)wParam,
-                                (HMENU)GetWindowLongPtrW( Wnd, 0 ) );
-         return 0;
-      }
-
-    case WM_ERASEBKGND:
-      return 1;
-
-    case WM_DESTROY:
-      /* zero out global pointer in case resident popup window was destroyed. */
-      if (Wnd == top_popup)
-        {
-          top_popup = NULL;
-          top_popup_hmenu = NULL;
-        }
-      break;
-
-#ifdef __REACTOS__
-    case WM_NCDESTROY:
-      NtUserSetWindowFNID(Wnd, FNID_DESTROY);
-      break;
-#endif
-
-    case WM_SHOWWINDOW:
-      if (0 != wParam)
-        {
-          if (0 == GetWindowLongPtrW(Wnd, 0))
-            {
-              OutputDebugStringA("no menu to display\n");
-            }
-        }
-      else
-        {
-          SetWindowLongPtrW(Wnd, 0, 0);
-        }
-      break;
-
-    case MM_SETMENUHANDLE:
-      SetWindowLongPtrW(Wnd, 0, wParam);
-      break;
-
-    case MM_GETMENUHANDLE:
-    case MN_GETHMENU:
-      return GetWindowLongPtrW(Wnd, 0);
-
-    default:
-      return DefWindowProcW(Wnd, Message, wParam, lParam);
-    }
-
-  return 0;
-}
-
 //
 // This breaks some test results. Should handle A2U if called!
 //
@@ -2608,7 +2522,6 @@
     case WM_ERASEBKGND:
     case WM_DESTROY:
     case WM_NCDESTROY:
-    case WM_SHOWWINDOW:
     case MM_SETMENUHANDLE:
     case MM_GETMENUHANDLE:
     case MN_GETHMENU: 
@@ -4051,7 +3964,7 @@
 static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
 {
     ROSMENUINFO MenuInfo = {0};
-    
+
     TRACE("hwnd=%p hmenu=%p\n", hWnd, hMenu);
 
     if (!MenuGetRosMenuInfo(&MenuInfo, hMenu)) return FALSE;
@@ -4093,7 +4006,7 @@
        {
           /* app changed/recreated menu bar entries in WM_INITMENU
              Recalculate menu sizes else clicks will not work */
-             SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
+          SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
                        SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
 
        }
