Index: trunk/src/user32/menu.cpp
===================================================================
--- trunk/src/user32/menu.cpp	(revision 2575)
+++ trunk/src/user32/menu.cpp	(revision 2577)
@@ -1,3 +1,3 @@
-/* $Id: menu.cpp,v 1.12 2000-01-20 16:48:54 cbratschi Exp $*/
+/* $Id: menu.cpp,v 1.13 2000-01-30 18:48:27 sandervl Exp $*/
 /*
  * Menu functions
@@ -3216,17 +3216,17 @@
  *         GetMenuString32A    (USER32.268)
  */
-INT WINAPI GetMenuStringA( HMENU hMenu, UINT wItemID,
-                               LPSTR str, INT nMaxSiz, UINT wFlags )
+INT WINAPI GetMenuStringA(HMENU hMenu, UINT wItemID,
+                          LPSTR str, INT nMaxSiz, UINT wFlags )
 {
     MENUITEM *item;
 
-    dprintf(("USER32: GetMenuStringA"));
+    dprintf(("USER32: GetMenuStringA %x %d %d %x", hMenu, wItemID, nMaxSiz, wFlags));
 
     //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
     //             hMenu, wItemID, str, nMaxSiz, wFlags );
-    if (!str || !nMaxSiz) return 0;
-    str[0] = '\0';
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
     if (!IS_STRING_ITEM(item->fType)) return 0;
+    if (!str || !nMaxSiz) return strlen(item->text);
+    str[0] = '\0';
     lstrcpynA( str, item->text, nMaxSiz );
     //TRACE("returning '%s'\n", str );
@@ -3247,8 +3247,8 @@
     //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
     //             hMenu, wItemID, str, nMaxSiz, wFlags );
-    if (!str || !nMaxSiz) return 0;
-    str[0] = '\0';
     if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
     if (!IS_STRING_ITEM(item->fType)) return 0;
+    if (!str || !nMaxSiz) return strlen(item->text);
+    str[0] = '\0';
     lstrcpynAtoW( str, item->text, nMaxSiz );
     return lstrlenW(str);
@@ -3773,5 +3773,7 @@
             lpmenu->Height = 0;  /* Make sure we recalculate the size */
         }
-        if (IsWindowVisible(hWnd))
+//SvL: This fixes the menu in standard mine sweeper (window isn't visible
+//     when SetMenu is called)
+//        if (IsWindowVisible(hWnd))
             SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
                         SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
@@ -4316,5 +4318,4 @@
      HWND referenceHwnd;
 
-     dprintf(("USER32: GetMenuItemRect"));
      //TRACE("(0x%x,0x%x,%d,%p)\n", hwnd, hMenu, uItem, rect);
 
@@ -4325,6 +4326,8 @@
      {
          itemMenu = (POPUPMENU*)hMenu;
-         if (itemMenu == NULL)
-             return FALSE;
+         if (itemMenu == NULL) {
+		SetLastError(ERROR_INVALID_PARAMETER);
+             	return FALSE;
+	 }
 
          if(itemMenu->hWnd == 0)
@@ -4333,10 +4336,12 @@
      }
 
-     if ((rect == NULL) || (item == NULL))
-         return FALSE;
-
+     if ((rect == NULL) || (item == NULL)) {
+	SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+     }
      *rect = item->rect;
 
      MapWindowPoints(referenceHwnd, 0, (LPPOINT)rect, 2);
+     dprintf(("USER32: GetMenuItemRect %x %x %d (%d,%d)(%d,%d)", hwnd, hMenu, uItem, rect->left, rect->top, rect->right, rect->bottom));
 
      return TRUE;
Index: trunk/src/user32/win32wbasenonclient.cpp
===================================================================
--- trunk/src/user32/win32wbasenonclient.cpp	(revision 2575)
+++ trunk/src/user32/win32wbasenonclient.cpp	(revision 2577)
@@ -1,3 +1,3 @@
-/* $Id: win32wbasenonclient.cpp,v 1.6 2000-01-27 17:21:09 cbratschi Exp $ */
+/* $Id: win32wbasenonclient.cpp,v 1.7 2000-01-30 18:48:29 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2 (non-client methods)
@@ -1025,4 +1025,6 @@
    */
 
+  dprintf(("DoNCPaint %x %x %d", getWindowHandle(), clip, suppress_menupaint));
+
   if (!(hdc = GetDCEx( Win32Hwnd, (clip > 1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
                       ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return;
@@ -1036,5 +1038,6 @@
     //CB: unknown WINE handling (clip == 1), clip client?
     GetRgnBox( clip, &rectClip );
-  } else
+  } 
+  else
   {
     clip = 0;
@@ -1139,4 +1142,5 @@
 
   ReleaseDC(Win32Hwnd,hdc);
+  dprintf(("**DoNCPaint %x DONE", getWindowHandle()));
 }
 //******************************************************************************
Index: trunk/src/user32/windowmsg.cpp
===================================================================
--- trunk/src/user32/windowmsg.cpp	(revision 2575)
+++ trunk/src/user32/windowmsg.cpp	(revision 2577)
@@ -1,3 +1,3 @@
-/* $Id: windowmsg.cpp,v 1.17 2000-01-18 20:11:10 sandervl Exp $ */
+/* $Id: windowmsg.cpp,v 1.18 2000-01-30 18:48:29 sandervl Exp $ */
 /*
  * Win32 window message APIs for OS/2
@@ -130,5 +130,5 @@
     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     if(!window) {
-        dprintf(("SendMessageA, window %x not found", hwnd));
+        dprintf(("SendMessageA, %x %x %x window %x not found", msg, wParam, lParam, hwnd));
         return 0;
     }
