Index: trunk/src/user32/new/pmwindow.cpp
===================================================================
--- trunk/src/user32/new/pmwindow.cpp	(revision 337)
+++ trunk/src/user32/new/pmwindow.cpp	(revision 338)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.10 1999-07-18 14:56:36 sandervl Exp $ */
+/* $Id: pmwindow.cpp,v 1.11 1999-07-19 13:58:38 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -99,32 +99,32 @@
     //internal messages
     case WM_WIN32_POSTMESSAGEA:
-      	postmsg = (POSTMSG_PACKET *)mp1;
-      	if(postmsg == NULL) {
-          	dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!"));
-          	break;
-      	}
-      	win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);
-      	free(postmsg);
-	  	break;
-	
+        postmsg = (POSTMSG_PACKET *)mp1;
+        if(postmsg == NULL) {
+            dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!"));
+            break;
+        }
+        win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);
+        free(postmsg);
+        break;
+
     case WM_WIN32_POSTMESSAGEW:
-    	postmsg = (POSTMSG_PACKET *)mp1;
-    	if(postmsg == NULL) {
-        	dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!"));
-        	break;
-    	}
-    	win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);
-    	free(postmsg);
-    	break;
+        postmsg = (POSTMSG_PACKET *)mp1;
+        if(postmsg == NULL) {
+            dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!"));
+            break;
+        }
+        win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);
+        free(postmsg);
+        break;
 
     //OS/2 msgs
     case WM_CREATE:
         //Processing is done in after WinCreateWindow returns
-    	dprintf(("OS2: WM_CREATE %x", hwnd));
-    	RestoreOS2TIB();
-    	return (MRESULT)FALSE;
+        dprintf(("OS2: WM_CREATE %x", hwnd));
+        RestoreOS2TIB();
+        return (MRESULT)FALSE;
 
     case WM_QUIT:
-    	dprintf(("OS2: WM_QUIT %x", hwnd));
+        dprintf(("OS2: WM_QUIT %x", hwnd));
         if(win32wnd->MsgQuit()) {
                 goto RunDefWndProc;
@@ -133,5 +133,5 @@
 
     case WM_CLOSE:
-    	dprintf(("OS2: WM_CLOSE %x", hwnd));
+        dprintf(("OS2: WM_CLOSE %x", hwnd));
         if(win32wnd->MsgClose()) {
                 goto RunDefWndProc;
@@ -140,5 +140,5 @@
 
     case WM_DESTROY:
-    	dprintf(("OS2: WM_DESTROY %x", hwnd));
+        dprintf(("OS2: WM_DESTROY %x", hwnd));
         if(win32wnd->MsgDestroy()) {
                 goto RunDefWndProc;
@@ -147,5 +147,5 @@
 
     case WM_ENABLE:
-    	dprintf(("OS2: WM_ENABLE %x", hwnd));
+        dprintf(("OS2: WM_ENABLE %x", hwnd));
         if(win32wnd->MsgEnable((ULONG)mp1)) {
                 goto RunDefWndProc;
@@ -154,5 +154,5 @@
 
     case WM_SHOW:
-    	dprintf(("OS2: WM_SHOW %x", hwnd));
+        dprintf(("OS2: WM_SHOW %x", hwnd));
         if(win32wnd->MsgShow((ULONG)mp1)) {
                 goto RunDefWndProc;
@@ -165,7 +165,7 @@
       ULONG x, y;
 
-    	dprintf(("OS2: WM_MOVE %x", hwnd));
-
-    	WinQueryWindowRect(hwnd, (PRECTL)&rectChild);
+        dprintf(("OS2: WM_MOVE %x", hwnd));
+
+        WinQueryWindowRect(hwnd, (PRECTL)&rectChild);
 
         //Calculate position relative to parent window (real window or desktop)
@@ -181,10 +181,10 @@
     case WM_WINDOWPOSCHANGED:
     {
-    	dprintf(("OS2: WM_WINDOWPOSCHANGED %x", hwnd));
+        dprintf(("OS2: WM_WINDOWPOSCHANGED %x", hwnd));
     }
 
     case WM_ADJUSTWINDOWPOS:
     {
-    	dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));
+        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd));
 //          if(win32wnd->MsgWindowPosChanging(0, 0)) {
                 goto RunDefWndProc;
@@ -197,5 +197,5 @@
      HPS hps;
 
-    	dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd));
+        dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd));
         hps = WinGetPS(hwnd);
         if(!win32wnd->MsgEraseBackGround((ULONG)hps))
@@ -215,5 +215,5 @@
      SWP swp;
 
-    	dprintf(("OS2: WM_SIZE %x", hwnd));
+        dprintf(("OS2: WM_SIZE %x", hwnd));
         rc = WinQueryWindowPos(hwnd, &swp);
         if(rc == FALSE) {
@@ -234,5 +234,5 @@
       HWND hwndActivate = (HWND)mp1;
 
-    	dprintf(("OS2: WM_ACTIVATE %x", hwnd));
+        dprintf(("OS2: WM_ACTIVATE %x", hwnd));
         if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
                 //another (non-win32) application's window
@@ -246,5 +246,5 @@
     }
     case WM_FOCUSCHANGE:
-    	dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
+        dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
         goto RunDefWndProc;
 
@@ -253,5 +253,5 @@
       HWND hwndFocus = (HWND)mp1;
 
-    	dprintf(("OS2: WM_SETFOCUS %x", hwnd));
+        dprintf(("OS2: WM_SETFOCUS %x", hwnd));
         if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
                 //another (non-win32) application's window
@@ -272,5 +272,5 @@
     //**************************************************************************
     case WM_BUTTON1DOWN:
-    	dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
+        dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
         if(win32wnd->MsgButton(BUTTON_LEFTDOWN, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) {
                 goto RunDefWndProc;
@@ -278,5 +278,5 @@
         break;
     case WM_BUTTON1UP:
-    	dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
+        dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
         if(win32wnd->MsgButton(BUTTON_LEFTUP, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) {
                 goto RunDefWndProc;
@@ -332,16 +332,16 @@
     case WM_MOUSEMOVE:
     {
-		ULONG keystate = 0;
-		if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
-			keystate |= WMMOVE_LBUTTON;
-		if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
-			keystate |= WMMOVE_MBUTTON;
-		if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
-			keystate |= WMMOVE_RBUTTON;
-		if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
-			keystate |= WMMOVE_SHIFT;
-		if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
-			keystate |= WMMOVE_CTRL;
-			
+        ULONG keystate = 0;
+        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
+            keystate |= WMMOVE_LBUTTON;
+        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
+            keystate |= WMMOVE_MBUTTON;
+        if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
+            keystate |= WMMOVE_RBUTTON;
+        if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
+            keystate |= WMMOVE_SHIFT;
+        if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
+            keystate |= WMMOVE_CTRL;
+
         if(!win32wnd->MsgMouseMove(keystate, (*(POINTS *)&mp1).x, MapOS2ToWin32Y(hwnd, (*(POINTS *)&mp1).y))) {
                 goto RunDefWndProc;
@@ -359,4 +359,10 @@
 
     case WM_COMMAND:
+        if(SHORT1FROMMP(mp2) == CMDSRC_MENU) {
+            win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0);
+        }
+        //todo controls + accelerators
+        break;
+
     case WM_SYSCOMMAND:
 
@@ -369,21 +375,21 @@
 
     case WM_TIMER:
-    	goto RunDefWndProc;
-		
+        goto RunDefWndProc;
+
     case WM_SETWINDOWPARAMS:
     {
       WNDPARAMS *wndParams = (WNDPARAMS *)mp1;
 
-    	dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
-    	if(wndParams->fsStatus & WPM_TEXT) {
+        dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
+        if(wndParams->fsStatus & WPM_TEXT) {
             if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
                     goto RunDefWndProc;
             }
-    	}
-    	goto RunDefWndProc;
+        }
+        goto RunDefWndProc;
     }
 
     case WM_PAINT:
-    	dprintf(("OS2: WM_PAINT %x", hwnd));
+        dprintf(("OS2: WM_PAINT %x", hwnd));
         if(win32wnd->MsgPaint(0, 0)) {
                 goto RunDefWndProc;
@@ -395,6 +401,6 @@
                 goto RunDefWndProc;
         }
-    	break;
-    	
+        break;
+
     case WM_SYSCOLORCHANGE:
     case WM_SYSVALUECHANGED:
@@ -420,5 +426,5 @@
     case WM_SEMANTICEVENT:
     default:
-    	dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
+        dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
         RestoreOS2TIB();
         return WinDefWindowProc( hwnd, msg, mp1, mp2 );
Index: trunk/src/user32/new/win32wnd.cpp
===================================================================
--- trunk/src/user32/new/win32wnd.cpp	(revision 337)
+++ trunk/src/user32/new/win32wnd.cpp	(revision 338)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.cpp,v 1.14 1999-07-19 11:50:04 sandervl Exp $ */
+/* $Id: win32wnd.cpp,v 1.15 1999-07-19 13:58:38 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -669,4 +669,17 @@
 {
   return SendInternalMessageA(WM_MOVE, 0, MAKELONG((USHORT)xParent, (USHORT)yParent));
+}
+//******************************************************************************
+//******************************************************************************
+ULONG Win32Window::MsgCommand(ULONG cmd, ULONG Id, HWND hwnd)
+{
+  switch(cmd) {
+    case CMD_MENU:
+        return SendInternalMessageA(WM_COMMAND, MAKELONG(Id, 0), 0);
+    case CMD_CONTROL:
+        return 0; //todo
+    case CMD_ACCELERATOR:
+        return 0; //todo
+  }
 }
 //******************************************************************************
Index: trunk/src/user32/new/win32wnd.h
===================================================================
--- trunk/src/user32/new/win32wnd.h	(revision 337)
+++ trunk/src/user32/new/win32wnd.h	(revision 338)
@@ -1,3 +1,3 @@
-/* $Id: win32wnd.h,v 1.13 1999-07-18 18:04:30 sandervl Exp $ */
+/* $Id: win32wnd.h,v 1.14 1999-07-19 13:58:39 sandervl Exp $ */
 /*
  * Win32 Window Code for OS/2
@@ -64,4 +64,5 @@
 	 ULONG  MsgSetFocus(HWND hwnd);
 	 ULONG  MsgKillFocus(HWND hwnd);
+	 ULONG  MsgCommand(ULONG cmd, ULONG Id, HWND hwnd);
 	 ULONG  MsgButton(ULONG msg, ULONG x, ULONG y);
 	 ULONG  MsgMouseMove(ULONG keystate, ULONG x, ULONG y);
@@ -234,4 +235,8 @@
 
 
+#define CMD_MENU		1
+#define CMD_CONTROL		2
+#define CMD_ACCELERATOR		3
+
 #endif //__cplusplus
 
