Index: trunk/src/user32/new/makefile
===================================================================
--- trunk/src/user32/new/makefile	(revision 2414)
+++ trunk/src/user32/new/makefile	(revision 2415)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.56 2000-01-11 10:38:33 sandervl Exp $
+# $Id: makefile,v 1.57 2000-01-12 12:40:41 sandervl Exp $
 
 #
@@ -115,5 +115,5 @@
 icontitle.obj: icontitle.cpp $(PDWIN32_INCLUDE)\win\icontitle.h
 
-msgbox.obj:    msgbox.cpp
+msgbox.obj:    msgbox.c
 window.obj:    window.cpp win32class.h win32wbase.h win32wndchild.h oslibwin.h win32wmdiclient.h win32wdesktop.h
 windowmsg.obj: windowmsg.cpp win32class.h win32wbase.h win32wndchild.h oslibmsg.h
Index: trunk/src/user32/new/menu.cpp
===================================================================
--- trunk/src/user32/new/menu.cpp	(revision 2414)
+++ trunk/src/user32/new/menu.cpp	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: menu.cpp,v 1.7 2000-01-11 17:34:42 cbratschi Exp $*/
+/* $Id: menu.cpp,v 1.8 2000-01-12 12:40:43 sandervl Exp $*/
 /*
  * Menu functions
@@ -2402,6 +2402,7 @@
         if( hNewWnd != pmt->hOwnerWnd )
         {
-            ReleaseCapture();
+            ReleaseCapture(); 
             pmt->hOwnerWnd = hNewWnd;
+	    SetCapture(pmt->hOwnerWnd); //SvL: Don't know if this is good enough
             //EVENT_Capture( pmt->hOwnerWnd, HTMENU ); //CB: todo
         }
@@ -2594,4 +2595,6 @@
 
     //EVENT_Capture( mt.hOwnerWnd, HTMENU ); //CB: todo
+    //SvL: Set keyboard & mouse event capture
+    SetCapture(mt.hOwnerWnd);
 
     while (!fEndMenu)
@@ -2602,5 +2605,7 @@
         /* we have to keep the message in the queue until it's
          * clear that menu loop is not over yet. */
-        if (!GetMessageA(&msg,msg.hwnd,0,0)) break;
+//        if (!GetMessageA(&msg,msg.hwnd,0,0)) break;
+	//SvL: Getting messages for only the menu delays background paints (i.e. VPBuddy logo)
+        if (!GetMessageA(&msg,0,0,0)) break;
         TranslateMessage( &msg );
         mt.pt = msg.pt;
@@ -2610,5 +2615,5 @@
 
         fRemove = FALSE;
-        if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
+        if((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
         {
             /* Find a menu for this mouse event */
Index: trunk/src/user32/new/msgbox.c
===================================================================
--- trunk/src/user32/new/msgbox.c	(revision 2415)
+++ trunk/src/user32/new/msgbox.c	(revision 2415)
@@ -0,0 +1,373 @@
+/* $Id: msgbox.c,v 1.1 2000-01-12 12:41:20 sandervl Exp $ */
+/*
+ * Message boxes (based on Wine code)
+ *
+ * Copyright 1995 Bernd Schmidt
+ *
+ *
+ */
+#include <win\winbase.h>
+#include <win\winuser.h>
+#include <string.h>
+#include <dlgs.h>
+#include <misc.h>
+#include <heapstring.h>
+
+#define MSGBOX_IDICON 1088
+#define MSGBOX_IDTEXT 100
+
+static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb)
+{
+    static HFONT hFont = 0, hPrevFont = 0;
+    RECT rect;
+    HWND hItem;
+    HDC hdc;
+    int i, buttons;
+    int bspace, bw, bh, theight, tleft, wwidth, wheight, bpos;
+    int borheight, borwidth, iheight, ileft, iwidth, twidth, tiheight;
+    LPCSTR lpszText;
+    char buf[256];
+
+////    if (TWEAK_WineLook >= WIN95_LOOK) {
+	NONCLIENTMETRICSA nclm;
+////	INT i;
+	nclm.cbSize = sizeof(NONCLIENTMETRICSA);
+	SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
+	hFont = CreateFontIndirectA (&nclm.lfMessageFont);
+	/* set button font */
+	for (i=1; i < 8; i++)
+	    SendDlgItemMessageA (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
+	/* set text font */
+	SendDlgItemMessageA (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0);
+////    }
+    if (HIWORD(lpmb->lpszCaption)) {
+       SetWindowTextA(hwnd, lpmb->lpszCaption);
+    } else {
+       if (LoadStringA(lpmb->hInstance, LOWORD(lpmb->lpszCaption), buf, sizeof(buf)))
+	  SetWindowTextA(hwnd, buf);
+    }
+    if (HIWORD(lpmb->lpszText)) {
+       lpszText = lpmb->lpszText;
+    } else {
+       lpszText = buf;
+       if (!LoadStringA(lpmb->hInstance, LOWORD(lpmb->lpszText), buf, sizeof(buf)))
+	  *buf = 0;	/* FIXME ?? */
+    }
+    SetWindowTextA(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpszText);
+
+    /* Hide not selected buttons */
+    switch(lpmb->dwStyle & MB_TYPEMASK) {
+    case MB_OK:
+	ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
+	/* fall through */
+    case MB_OKCANCEL:
+	ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
+	break;
+    case MB_ABORTRETRYIGNORE:
+	ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
+	break;
+    case MB_YESNO:
+	ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
+	/* fall through */
+    case MB_YESNOCANCEL:
+	ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
+	break;
+    case MB_RETRYCANCEL:
+	ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
+	ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
+	break;
+    }
+    /* Set the icon */
+    switch(lpmb->dwStyle & MB_ICONMASK) {
+    case MB_ICONEXCLAMATION:
+	SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
+			   (WPARAM)LoadIconA(0, IDI_EXCLAMATIONA), 0);
+	break;
+    case MB_ICONQUESTION:
+	SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
+			     (WPARAM)LoadIconA(0, IDI_QUESTIONA), 0);
+	break;
+    case MB_ICONASTERISK:
+	SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
+			     (WPARAM)LoadIconA(0, IDI_ASTERISKA), 0);
+	break;
+    case MB_ICONHAND:
+    default:
+	SendDlgItemMessageA(hwnd, stc1, STM_SETICON,
+			     (WPARAM)LoadIconA(0, IDI_HANDA), 0);
+	break;
+    }
+    
+    /* Position everything */
+    GetWindowRect(hwnd, &rect);
+    borheight = rect.bottom - rect.top;
+    borwidth  = rect.right - rect.left;
+    GetClientRect(hwnd, &rect);
+    borheight -= rect.bottom - rect.top;
+    borwidth  -= rect.right - rect.left;
+    
+    /* Get the icon height */
+    GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect);
+    MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2);
+    iheight = rect.bottom - rect.top;
+    ileft = rect.left;
+    iwidth = rect.right - ileft;
+    
+    hdc = GetDC(hwnd);
+    if (hFont)
+	hPrevFont = SelectObject(hdc, hFont);
+    
+    /* Get the number of visible buttons and their size */
+    bh = bw = 1; /* Minimum button sizes */
+    for (buttons = 0, i = 1; i < 8; i++)
+    {
+	hItem = GetDlgItem(hwnd, i);
+	if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE)
+	{
+	    char buttonText[1024];
+	    int w, h;
+	    buttons++;
+	    if (GetWindowTextA(hItem, buttonText, sizeof buttonText))
+	    {
+		DrawTextA( hdc, buttonText, -1, &rect, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT);
+		h = rect.bottom - rect.top;
+		w = rect.right - rect.left;
+		if (h > bh) bh = h;
+		if (w > bw)  bw = w ;
+	    }
+	}
+    }
+    bw = MAX(bw, bh * 2);
+    /* Button white space */
+    bh = bh * 2;
+    bw = bw * 2;
+    bspace = bw/3; /* Space between buttons */
+    
+    /* Get the text size */
+    GetClientRect(GetDlgItem(hwnd, MSGBOX_IDTEXT), &rect);
+    rect.top = rect.left = rect.bottom = 0;
+    DrawTextA( hdc, lpszText, -1, &rect,
+	       DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT);
+    /* Min text width corresponds to space for the buttons */
+    tleft = 2 * ileft + iwidth;
+    twidth = MAX((bw + bspace) * buttons + bspace - tleft, rect.right);
+    theight = rect.bottom;
+    
+    if (hFont)
+	SelectObject(hdc, hPrevFont);
+    ReleaseDC(hItem, hdc);
+    
+    tiheight = 16 + MAX(iheight, theight);
+    wwidth  = tleft + twidth + ileft + borwidth;
+    wheight = 8 + tiheight + bh + borheight;
+    
+    /* Resize the window */
+    SetWindowPos(hwnd, 0, 0, 0, wwidth, wheight,
+		 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
+    
+    /* Position the icon */
+    SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0,
+		 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
+    
+    /* Position the text */
+    SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight,
+		 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
+    
+    /* Position the buttons */
+    bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2;
+    for (buttons = i = 0; i < 7; i++) {
+	/* some arithmetic to get the right order for YesNoCancel windows */
+	hItem = GetDlgItem(hwnd, (i + 5) % 7 + 1);
+	if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE) {
+	    if (buttons++ == ((lpmb->dwStyle & MB_DEFMASK) >> 8)) {
+		SetFocus(hItem);
+		SendMessageA( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
+	    }
+	    SetWindowPos(hItem, 0, bpos, tiheight, bw, bh,
+			 SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
+	    bpos += bw + bspace;
+	}
+    }
+    return hFont;
+}
+
+
+/**************************************************************************
+ *           MSGBOX_DlgProc
+ *
+ * Dialog procedure for message boxes.
+ */
+static LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
+                                        WPARAM wParam, LPARAM lParam )
+{  
+  static HFONT hFont;
+  switch(message) {
+   case WM_INITDIALOG:
+    hFont = MSGBOX_OnInit(hwnd, (LPMSGBOXPARAMSA)lParam);
+    return 0;
+    
+   case WM_COMMAND:
+    switch (wParam)
+    {
+     case IDOK:
+     case IDCANCEL:
+     case IDABORT:
+     case IDRETRY:
+     case IDIGNORE:
+     case IDYES:
+     case IDNO:
+      EndDialog(hwnd, wParam);
+      if (hFont)
+	  DeleteObject(hFont);
+      break;
+    }
+
+   default:
+     /* Ok. Ignore all the other messages */
+     //TRACE("Message number %i is being ignored.\n", message);
+    break;
+  }
+  return 0;
+}
+
+/**************************************************************************
+ *           MessageBox32A   (USER32.391)
+ *
+ * NOTES
+ *   The WARN is here to help debug erroneous MessageBoxes
+ *   Use: -debugmsg warn+dialog,+relay
+ */
+INT WINAPI MessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type)
+{
+    LPVOID lpTemplate;
+    HRSRC hRes;
+    MSGBOXPARAMSA mbox;
+
+    dprintf(("MessageBoxA %x %s %s %x", hWnd, text, title, type));
+
+    if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
+        return 0;
+    if(!(lpTemplate = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
+        return 0;
+
+    if (!text) text="<ODIN-NULL>";
+    if (!title)
+      title="Error";
+    mbox.lpszCaption = title;
+    mbox.lpszText  = text;
+    mbox.dwStyle  = type;
+    return DialogBoxIndirectParamA( GetWindowLongA(hWnd,GWL_HINSTANCE), lpTemplate,
+                                      hWnd, (DLGPROC)MSGBOX_DlgProc, (LPARAM)&mbox );
+}
+
+
+/**************************************************************************
+ *           MessageBox32W   (USER32.396)
+ */
+INT WINAPI MessageBoxW( HWND hwnd, LPCWSTR text, LPCWSTR title,
+                            UINT type )
+{
+    LPSTR titleA = HEAP_strdupWtoA( GetProcessHeap(), 0, title );
+    LPSTR textA  = HEAP_strdupWtoA( GetProcessHeap(), 0, text );
+    INT ret;
+    
+    ret = MessageBoxA( hwnd, textA, titleA, type );
+    HeapFree( GetProcessHeap(), 0, titleA );
+    HeapFree( GetProcessHeap(), 0, textA );
+    return ret;
+}
+
+
+/**************************************************************************
+ *           MessageBoxEx32A   (USER32.392)
+ */
+INT WINAPI MessageBoxExA( HWND hWnd, LPCSTR text, LPCSTR title,
+                              UINT type, WORD langid )
+{
+    /* ignore language id for now */
+    return MessageBoxA(hWnd,text,title,type);
+}
+
+/**************************************************************************
+ *           MessageBoxEx32W   (USER32.393)
+ */
+INT WINAPI MessageBoxExW( HWND hWnd, LPCWSTR text, LPCWSTR title,
+                              UINT type, WORD langid )
+{
+    /* ignore language id for now */
+    return MessageBoxW(hWnd,text,title,type);
+}
+
+
+/**************************************************************************
+ *           MessageBoxIndirect32A   (USER32.394)
+ */
+INT WINAPI MessageBoxIndirectA( LPMSGBOXPARAMSA msgbox )
+{
+    LPVOID lpTemplate;
+    HRSRC hRes;
+
+    dprintf(("MessageBoxIndirectA %x", msgbox));
+
+    if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
+        return 0;
+    if(!(lpTemplate = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
+        return 0;
+
+    return DialogBoxIndirectParamA( msgbox->hInstance, lpTemplate,
+                                      msgbox->hwndOwner, (DLGPROC)MSGBOX_DlgProc,
+				      (LPARAM)msgbox );
+}
+
+/**************************************************************************
+ *           MessageBoxIndirect32W   (USER32.395)
+ */
+INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox )
+{
+    MSGBOXPARAMSA	msgboxa;
+
+    memcpy(&msgboxa,msgbox,sizeof(msgboxa));
+    if (msgbox->lpszCaption)	
+      lstrcpyWtoA((LPSTR)msgboxa.lpszCaption,msgbox->lpszCaption);
+    if (msgbox->lpszText)	
+      lstrcpyWtoA((LPSTR)msgboxa.lpszText,msgbox->lpszText);
+
+    return MessageBoxIndirectA(&msgboxa);
+}
+
+/*****************************************************************************
+ * Name      : BOOL WIN32API SysErrorBox
+ * Purpose   : Unknown
+ * Parameters: Unknown
+ * Variables :
+ * Result    :
+ * Remark    : HARDERR like ?
+ * Status    : UNTESTED UNKNOWN STUB
+ *
+ * Author    : Patrick Haller [Wed, 1998/06/16 11:55]
+ *****************************************************************************/
+
+BOOL WIN32API SysErrorBox(DWORD x1,
+                             DWORD x2,
+                             DWORD x3)
+{
+  dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh) not implemented.\n",
+           x1,
+           x2,
+           x3));
+
+  return (FALSE); /* default */
+}
Index: trunk/src/user32/new/msgbox.cpp
===================================================================
--- trunk/src/user32/new/msgbox.cpp	(revision 2414)
+++ 	(revision )
@@ -1,189 +1,0 @@
-/* $Id: msgbox.cpp,v 1.4 2000-01-01 14:57:17 cbratschi Exp $ */
-/*
- * Win32 message box function for OS/2
- *
- * Copyright 1999 Sander van Leeuwen
- *
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-#include <os2win.h>
-#include <misc.h>
-#include "win32wnd.h"
-
-/*****************************************************************************
- * Name      : int WIN32API MessageBoxExA
- * Purpose   : The MessageBoxEx function creates, displays, and operates a message box.
- * Parameters: HWND    hWnd        handle of owner window
- *             LPCTSTR lpText      address of text in message box
- *             LPCTSTR lpCaption   address of title of message box
- *             UINT    uType       style of message box
- *             WORD    wLanguageId language identifier
- * Variables :
- * Result    : If the function succeeds, the return value is a nonzero menu-item
- *             value returned by the dialog box.
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
- *****************************************************************************/
-
-int WIN32API MessageBoxExA(HWND    hWnd,
-                           LPCTSTR lpText,
-                           LPCTSTR lpCaption,
-                           UINT    uType,
-                           WORD    wLanguageId)
-{
-  dprintf(("USER32:MessageBoxExA (%08xh,%s,%s,%u,%08w) not implemented.\n",
-         hWnd,
-         lpText,
-         lpCaption,
-         uType,
-         wLanguageId));
-
-  return (MessageBoxA(hWnd,
-                      lpText,
-                      lpCaption,
-                      uType));
-}
-
-
-/*****************************************************************************
- * Name      : int WIN32API MessageBoxExW
- * Purpose   : The MessageBoxEx function creates, displays, and operates a message box.
- * Parameters: HWND    hWnd        handle of owner window
- *             LPCTSTR lpText      address of text in message box
- *             LPCTSTR lpCaption   address of title of message box
- *             UINT    uType       style of message box
- *             WORD    wLanguageId language identifier
- * Variables :
- * Result    : If the function succeeds, the return value is a nonzero menu-item
- *             value returned by the dialog box.
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
- *****************************************************************************/
-
-int WIN32API MessageBoxExW(HWND    hWnd,
-                           LPCWSTR lpText,
-                           LPCWSTR lpCaption,
-                           UINT    uType,
-                           WORD    wLanguageId)
-{
-
-  dprintf(("USER32:MessageBoxExW (%08xh,%x,%x,%u,%08w) not implemented.\n",
-         hWnd,
-         lpText,
-         lpCaption,
-         uType,
-         wLanguageId));
-
-  return MessageBoxW(hWnd, lpText, lpCaption, uType);
-}
-
-
-/*****************************************************************************
- * Name      : BOOL WIN32API MessageBoxIndirectW
- * Purpose   : The MessageBoxIndirect function creates, displays, and operates
- *             a message box. The message box contains application-defined
- *             message text and title, any icon, and any combination of
- *             predefined push buttons.
- * Parameters:
- * Variables :
- * Result    :
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
- *****************************************************************************/
-
-// @@@PH Win32 BOOL's are casted to INTs
-INT WIN32API MessageBoxIndirectW(LPMSGBOXPARAMSW lpMsgBoxParams)
-{
-  dprintf(("USER32:MessageBoxIndirectW (%08x) partially implemented.\n",
-         lpMsgBoxParams));
-
-  return (MessageBoxW(lpMsgBoxParams->hwndOwner,
-                      lpMsgBoxParams->lpszText,
-                      lpMsgBoxParams->lpszCaption,
-                      lpMsgBoxParams->dwStyle));
-}
-
-
-/*****************************************************************************
- * Name      : BOOL WIN32API MessageBoxIndirectA
- * Purpose   : The MessageBoxIndirect function creates, displays, and operates
- *             a message box. The message box contains application-defined
- *             message text and title, any icon, and any combination of
- *             predefined push buttons.
- * Parameters:
- * Variables :
- * Result    :
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
- *****************************************************************************/
-
-// @@@PH Win32 BOOL's are casted to INTs
-INT  WIN32API MessageBoxIndirectA(LPMSGBOXPARAMSA lpMsgBoxParams)
-{
-  dprintf(("USER32:MessageBoxIndirectA (%08x) partially implemented.\n",
-         lpMsgBoxParams));
-
-  return (MessageBoxA(lpMsgBoxParams->hwndOwner,
-                      lpMsgBoxParams->lpszText,
-                      lpMsgBoxParams->lpszCaption,
-                      lpMsgBoxParams->dwStyle));
-}
-//******************************************************************************
-//******************************************************************************
-int WIN32API MessageBoxA(HWND hwndOwner, LPCTSTR lpszText, LPCTSTR lpszTitle, UINT fuStyle)
-{
-  dprintf(("USER32:  MessageBoxA %s %s\n", lpszText, lpszTitle));
-  hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
-  return(O32_MessageBox(hwndOwner, lpszText, lpszTitle, fuStyle));
-}
-//******************************************************************************
-//******************************************************************************
-int WIN32API MessageBoxW(HWND hwndOwner, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
-{
- char *astring1, *astring2;
- int   rc;
-
-    astring1 = UnicodeToAsciiString((LPWSTR)arg2);
-    astring2 = UnicodeToAsciiString((LPWSTR)arg3);
-#ifdef DEBUG
-    WriteLog("USER32:  MessageBoxW %s %s\n", astring1, astring2);
-#endif
-    hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
-    rc = O32_MessageBox(hwndOwner, astring1, astring2, arg4);
-    FreeAsciiString(astring1);
-    FreeAsciiString(astring2);
-    return(rc);
-}
-/*****************************************************************************
- * Name      : BOOL WIN32API SysErrorBox
- * Purpose   : Unknown
- * Parameters: Unknown
- * Variables :
- * Result    :
- * Remark    : HARDERR like ?
- * Status    : UNTESTED UNKNOWN STUB
- *
- * Author    : Patrick Haller [Wed, 1998/06/16 11:55]
- *****************************************************************************/
-
-BOOL WIN32API SysErrorBox(DWORD x1,
-                             DWORD x2,
-                             DWORD x3)
-{
-  dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh) not implemented.\n",
-           x1,
-           x2,
-           x3));
-
-  return (FALSE); /* default */
-}
Index: trunk/src/user32/new/oslibmsgtranslate.cpp
===================================================================
--- trunk/src/user32/new/oslibmsgtranslate.cpp	(revision 2414)
+++ trunk/src/user32/new/oslibmsgtranslate.cpp	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: oslibmsgtranslate.cpp,v 1.10 2000-01-10 23:29:12 sandervl Exp $ */
+/* $Id: oslibmsgtranslate.cpp,v 1.11 2000-01-12 12:40:44 sandervl Exp $ */
 /*
  * Window message translation functions for OS/2
@@ -561,14 +561,4 @@
     }
 
-    case WM_INITMENU:
-        winMsg->message = WINWM_INITMENU;
-        winMsg->wParam  = (WPARAM)os2Msg->mp2; //hMenu
-        break;
-
-    case WM_MENUSELECT:
-    case WM_MENUEND:
-    case WM_NEXTMENU:
-        goto dummymessage;
-
     case WM_TIMER:
         if (os2Msg->mp2)
@@ -630,16 +620,8 @@
 
     case WM_CONTEXTMENU:
-    {
-        OSLIBPOINT pt;
-
-        pt.x = (*(POINTS *)&os2Msg->mp1).x;
-        pt.y = (*(POINTS *)&os2Msg->mp1).y;
-        mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
-        winMsg->message = WINWM_CONTEXTMENU;
-        winMsg->wParam  = (WPARAM)win32wnd->getWindowHandle();
-        winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
-        break;
-    }
-
+    case WM_INITMENU:
+    case WM_MENUSELECT:
+    case WM_MENUEND:
+    case WM_NEXTMENU:
     case WM_SYSCOLORCHANGE:
     case WM_SYSVALUECHANGED:
Index: trunk/src/user32/new/pmframe.cpp
===================================================================
--- trunk/src/user32/new/pmframe.cpp	(revision 2414)
+++ trunk/src/user32/new/pmframe.cpp	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: pmframe.cpp,v 1.10 2000-01-10 23:29:13 sandervl Exp $ */
+/* $Id: pmframe.cpp,v 1.11 2000-01-12 12:40:45 sandervl Exp $ */
 /*
  * Win32 Frame Managment Code for OS/2
@@ -107,28 +107,5 @@
   {
     case WM_FORMATFRAME:
-    {
-      PSWP pswp = (PSWP)mp1,swpClient;
-      RECTL *client = (PRECTL)mp2,rect;
-      RECT winRect;
-      INT ccount;
-
-      if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
-      dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd));
-      RestoreOS2TIB();
-      ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2);
-      SetWin32TIB();
-      dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight()));
-      win32wnd->MsgFormatFrame();
-      //CB: todo: use result for WM_CALCVALIDRECTS
-      mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
-      swpClient = &pswp[ccount-1];
-      swpClient->x = rect.xLeft;
-      swpClient->y = rect.yBottom;
-      swpClient->cx = rect.xRight-rect.xLeft;
-      swpClient->cy = rect.yTop-rect.yBottom;
-      dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
-      RestoreOS2TIB();
-      return (MRESULT)ccount;
-    }
+	break;
 
     case WM_MINMAXFRAME:
@@ -141,8 +118,10 @@
       {
         win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
-      } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
+      } 
+      else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
       {
         win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
-      } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
+      } 
+      else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
       {
         win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
@@ -277,9 +256,21 @@
       WINDOWPOS wp;
       HWND      hParent = NULLHANDLE;
+      RECTL rect;
+      SWP swpClient = {0};
 
         dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
 
         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
-            goto PosChangedEnd;
+	{
+		swpClient.hwnd = win32wnd->getOS2WindowHandle();
+		swpClient.hwndInsertBehind = 0;
+        	swpClient.x  = 0;
+        	swpClient.y  = 0;
+        	swpClient.cx = 0;
+        	swpClient.cy = 0;
+ 		swpClient.fl = pswp->fl & ~SWP_ZORDER;
+		WinSetMultWindowPos(thdb->hab, &swpClient, 1);
+            	goto PosChangedEnd;
+	}
 
         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
@@ -293,26 +284,33 @@
         OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
 
-        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
+        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
+        	win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
+
+        	win32wnd->MsgFormatFrame();
+        	//CB: todo: use result for WM_CALCVALIDRECTS
+        	mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
+
+		swpClient.hwnd = win32wnd->getOS2WindowHandle();
+		swpClient.hwndInsertBehind = 0;
+        	swpClient.x  = rect.xLeft;
+        	swpClient.y  = rect.yBottom;
+        	swpClient.cx = rect.xRight-rect.xLeft;
+        	swpClient.cy = rect.yTop-rect.yBottom;
+		//TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now
+ 		swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW;
+		WinSetMultWindowPos(thdb->hab, &swpClient, 1);
+	}
 
         if(win32wnd->CanReceiveSizeMsgs())
           win32wnd->MsgPosChanged((LPARAM)&wp);
 
+        //update child positions: rectWindow is in window coordinates
+        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
+        	FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
+	}
+
 PosChangedEnd:
-        //update the client rect
-        RECTL rectl;
-
-        WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
-        mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
-        WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
-        mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
-
-        //calls WM_FORMATFRAME if SWP_SIZE is set
         RestoreOS2TIB();
-        rc = OldFrameProc(hwnd,msg,mp1,mp2);
-        SetWin32TIB();
-        //update child positions: rectWindow is in window coordinates
-        FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
-        RestoreOS2TIB();
-        return rc;
+        return (MRESULT)FALSE;
     }
 
@@ -320,5 +318,5 @@
     {
       PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
-      UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;
+      UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP;
 
 //CB: todo: use WM_NCCALCSIZE result
@@ -334,7 +332,7 @@
 
       //CB: PM sets client window position
-      RestoreOS2TIB();
-      OldFrameProc(hwnd,msg,mp1,mp2);
-      SetWin32TIB();
+//      RestoreOS2TIB();
+//      OldFrameProc(hwnd,msg,mp1,mp2);
+//      SetWin32TIB();
 
       RestoreOS2TIB();
Index: trunk/src/user32/new/pmwindow.cpp
===================================================================
--- trunk/src/user32/new/pmwindow.cpp	(revision 2414)
+++ trunk/src/user32/new/pmwindow.cpp	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.35 2000-01-11 13:52:18 sandervl Exp $ */
+/* $Id: pmwindow.cpp,v 1.36 2000-01-12 12:40:46 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -245,5 +245,9 @@
 
     case WM_ADJUSTWINDOWPOS:
-        goto RunDefWndProc;
+    {
+      PSWP      pswp   = (PSWP)mp1;
+        dprintf(("PMWINDOW: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
+        goto RunDefWndProc;
+    }
 
     case WM_WINDOWPOSCHANGED:
@@ -366,15 +370,6 @@
         break;
 
-    case WM_INITMENU:
-        win32wnd->MsgInitMenu(pWinMsg);
-        break;
-
     case WM_TIMER:
         win32wnd->DispatchMsgA(pWinMsg);
-        goto RunDefWndProc;
-
-    case WM_MENUSELECT:
-    case WM_MENUEND:
-    case WM_NEXTMENU:
         goto RunDefWndProc;
 
@@ -434,4 +429,8 @@
         goto RunDefWndProc;
 
+    case WM_INITMENU:
+    case WM_MENUSELECT:
+    case WM_MENUEND:
+    case WM_NEXTMENU:
     case WM_SYSCOLORCHANGE:
     case WM_SYSVALUECHANGED:
Index: trunk/src/user32/new/user32.rc
===================================================================
--- trunk/src/user32/new/user32.rc	(revision 2414)
+++ trunk/src/user32/new/user32.rc	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: user32.rc,v 1.7 2000-01-03 20:53:50 cbratschi Exp $ */
+/* $Id: user32.rc,v 1.8 2000-01-12 12:40:46 sandervl Exp $ */
 /* converted from WINE */
 
@@ -806,4 +806,20 @@
 #define OCR_APPSTARTING     32650
 #define OCR_HELP            32651  /* only defined in Odin */
+
+
+MSGBOX DIALOG 100, 80, 216, 168
+STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+BEGIN
+        ICON "", 1088, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE
+        LTEXT "", 100, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP
+        PUSHBUTTON "&OK", 1, 16, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&Cancel", 2, 64, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&Abort", 3, 112, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&Retry", 4, 160, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&Ignore", 5, 208, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&Yes", 6, 256, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+        PUSHBUTTON "&No", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
Index: trunk/src/user32/new/win32wbase.cpp
===================================================================
--- trunk/src/user32/new/win32wbase.cpp	(revision 2414)
+++ trunk/src/user32/new/win32wbase.cpp	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.34 2000-01-11 17:34:43 cbratschi Exp $ */
+/* $Id: win32wbase.cpp,v 1.35 2000-01-12 12:40:47 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -1023,14 +1023,4 @@
 }
 //******************************************************************************
-//TODO: Depending on menu type, we should send WM_INITMENU or WM_INITPOPUPMENU
-//TODO: PM sends it for each submenu that gets activated; Windows only for the first
-//      submenu; once the menu bar is active, moving the cursor doesn't generate other
-//      WM_INITMENU msgs. Not really a problem, but might need to fix this later on.
-//******************************************************************************
-ULONG Win32BaseWindow::MsgInitMenu(MSG *msg)
-{
-    return SendInternalMessageA(msg->message, msg->wParam, msg->lParam);
-}
-//******************************************************************************
 //******************************************************************************
 ULONG Win32BaseWindow::MsgNCPaint()
@@ -1061,5 +1051,6 @@
 
     return rc;
-  } else return 0;
+  }
+  else return 0;
 }
 //******************************************************************************
@@ -1100,10 +1091,4 @@
     SendInternalMessageA(WM_GETTEXT, wndNameLength, (LPARAM)windowNameA);
     return windowNameA;
-}
-//******************************************************************************
-//******************************************************************************
-ULONG  Win32BaseWindow::MsgContextMenu(ULONG x,ULONG y)
-{
-  return SendInternalMessageA(WM_CONTEXTMENU,Win32Hwnd,MAKELPARAM(x,y));
 }
 //******************************************************************************
Index: trunk/src/user32/new/win32wbase.h
===================================================================
--- trunk/src/user32/new/win32wbase.h	(revision 2414)
+++ trunk/src/user32/new/win32wbase.h	(revision 2415)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.h,v 1.24 2000-01-11 17:34:44 cbratschi Exp $ */
+/* $Id: win32wbase.h,v 1.25 2000-01-12 12:40:49 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -115,5 +115,4 @@
          ULONG  MsgPaint(ULONG tmp1, BOOL select = TRUE);
          ULONG  MsgEraseBackGround(HDC hdc);
-         ULONG  MsgInitMenu(MSG *msg);
 	 ULONG  MsgHitTest(ULONG x, ULONG y);
          ULONG  MsgNCPaint();
@@ -125,5 +124,4 @@
          ULONG  MsgGetTextLength();
          char  *MsgGetText();
-         ULONG  MsgContextMenu(ULONG x,ULONG y);
          VOID   updateWindowStyle(DWORD oldExStyle,DWORD oldStyle);
 
