diff --git a/controls/menu.c b/controls/menu.c
index 0bc988b148a3c77e12f4082c9c39125d568313b5..7608eca2cc97bae809a30e61216f763840e5d9d3 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -2655,13 +2655,29 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
 	menu = MENU_GetMenu( mt.hCurrentMenu );
 	if (!menu) /* sometimes happens if I do a window manager close */
 	    break;
-	msg.hwnd = (wFlags & TPM_ENTERIDLEEX && menu->wFlags & MF_POPUP) ? menu->hWnd : 0;
 
 	/* we have to keep the message in the queue until it's
 	 * clear that menu loop is not over yet. */
 
-	if (!MSG_InternalGetMessage( &msg, msg.hwnd, mt.hOwnerWnd, 0, 0,
-				     MSGF_MENU, PM_NOREMOVE, !enterIdleSent, &enterIdleSent )) break;
+        for (;;)
+        {
+            if (PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ))
+            {
+                if (!CallMsgFilterA( &msg, MSGF_MENU )) break;
+                /* remove the message from the queue */
+                PeekMessageA( &msg, 0, msg.message, msg.message, PM_REMOVE );
+            }
+            else
+            {
+                if (!enterIdleSent)
+                {
+                    HWND win = (wFlags & TPM_ENTERIDLEEX && menu->wFlags & MF_POPUP) ? menu->hWnd : 0;
+                    enterIdleSent = TRUE;
+                    SendMessageW( mt.hOwnerWnd, WM_ENTERIDLE, MSGF_MENU, (LPARAM)win );
+                }
+                WaitMessage();
+            }
+        }
 
 	/* check if EndMenu() tried to cancel us, by posting this message */
         if(msg.message == WM_CANCELMODE) 
diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c
index 70961ed6fd42f9058398bf96afc01c8e652d407f..daed7d0f092af2263bb0b0ae6ebaf1140f4c2433 100644
--- a/dlls/x11drv/winpos.c
+++ b/dlls/x11drv/winpos.c
@@ -1596,8 +1596,9 @@ static LONG start_size_move( WND* wndPtr, WPARAM wParam, POINT *capturePoint )
     {
         while(!hittest)
         {
-            MSG_InternalGetMessage( &msg, 0, 0, WM_KEYFIRST, WM_MOUSELAST,
-                                    MSGF_SIZE, PM_REMOVE, FALSE, NULL );
+            GetMessageW( &msg, 0, WM_KEYFIRST, WM_MOUSELAST );
+            if (CallMsgFilterW( &msg, MSGF_SIZE )) continue;
+
             switch(msg.message)
             {
             case WM_MOUSEMOVE:
@@ -1776,8 +1777,8 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
     {
         int dx = 0, dy = 0;
 
-        MSG_InternalGetMessage( &msg, 0, 0, WM_KEYFIRST, WM_MOUSELAST,
-                                MSGF_SIZE, PM_REMOVE, FALSE, NULL );
+        if (!GetMessageW( &msg, 0, WM_KEYFIRST, WM_MOUSELAST )) break;
+        if (CallMsgFilterW( &msg, MSGF_SIZE )) continue;
 
         /* Exit on button-up, Return, or Esc */
         if ((msg.message == WM_LBUTTONUP) ||
diff --git a/windows/dialog.c b/windows/dialog.c
index 449b016239d126fbe75931da835f6e9a91ba4092..e76ab2693cbe5e60a92b081c51d8e2550128f5cf 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -25,7 +25,6 @@
 #include "heap.h"
 #include "win.h"
 #include "user.h"
-#include "message.h"
 #include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(dialog);
@@ -1053,13 +1052,25 @@ static INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
     if (!(dlgInfo->flags & DF_END)) /* was EndDialog called in WM_INITDIALOG ? */
     {
         ShowWindow( hwnd, SW_SHOW );
-        while (MSG_InternalGetMessage(&msg, hwnd, ownerMsg, 0, 0, MSGF_DIALOGBOX,
-                                      PM_REMOVE, !(wndPtr->dwStyle & DS_NOIDLEMSG), NULL ))
+        for (;;)
         {
-            if (!(dlgInfo->flags & DF_END) && (!IsDialogMessageA( hwnd, &msg)))
+            if (!(wndPtr->dwStyle & DS_NOIDLEMSG))
+            {
+                if (!PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
+                {
+                    /* No message present -> send ENTERIDLE and wait */
+                    SendMessageW( ownerMsg, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd );
+                    if (!GetMessageW( &msg, 0, 0, 0 )) break;
+                }
+            }
+            else if (!GetMessageW( &msg, 0, 0, 0 )) break;
+
+            if (CallMsgFilterW( &msg, MSGF_DIALOGBOX )) continue;
+
+            if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd, &msg))
             {
                 TranslateMessage( &msg );
-                DispatchMessageA( &msg );
+                DispatchMessageW( &msg );
             }
             if (dlgInfo->flags & DF_END) break;
         }
@@ -1460,7 +1471,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg,
 
         case VK_RETURN:
             {
-                DWORD dw = SendMessage16( hwndDlg, DM_GETDEFID, 0, 0 );
+                DWORD dw = SendMessageW( hwndDlg, DM_GETDEFID, 0, 0 );
                 if (HIWORD(dw) == DC_HASDEFID)
                 {
                     SendMessageA( hwndDlg, WM_COMMAND, 
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 287c6fb9153646bee7bd149af94b0a673455a06a..21bd53d0ff6ed14764aff5721568e6155341303a 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -10,7 +10,6 @@
 #include "wine/winuser16.h"
 #include "version.h"
 #include "win.h"
-#include "message.h"
 #include "user.h"
 #include "heap.h"
 #include "dce.h"
@@ -1847,8 +1846,9 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam )
     while(1)
     {
 	BOOL oldstate = pressed;
-        MSG_InternalGetMessage( &msg, 0, 0, WM_MOUSEFIRST, WM_MOUSELAST,
-                                0, PM_REMOVE, FALSE, NULL );
+
+        if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
+        if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
 
 	if(msg.message == WM_LBUTTONUP)
 	    break;
@@ -1903,8 +1903,9 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
     while(1)
     {
 	BOOL oldstate = pressed;
-        MSG_InternalGetMessage( &msg, 0, 0, WM_MOUSEFIRST, WM_MOUSELAST,
-                                0, PM_REMOVE, FALSE, NULL );
+
+        if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
+        if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
 
 	if(msg.message == WM_LBUTTONUP)
 	    break;
@@ -1965,8 +1966,9 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
     while(1)
     {
 	BOOL oldstate = pressed;
-        MSG_InternalGetMessage( &msg, 0, 0, WM_MOUSEFIRST, WM_MOUSELAST,
-                                0, PM_REMOVE, FALSE, NULL );
+
+        if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
+        if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
 
 	if(msg.message == WM_LBUTTONUP)
 	    break;
@@ -1997,7 +1999,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
  */
 static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
 {
-    MSG16 *msg;
+    MSG msg;
     INT scrollbar;
     WND *wndPtr = WIN_FindWndPtr( hwnd );
 
@@ -2012,7 +2014,6 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
 	scrollbar = SB_VERT;
     }
 
-    if (!(msg = SEGPTR_NEW(MSG16))) goto END;
     pt.x -= wndPtr->rectWindow.left;
     pt.y -= wndPtr->rectWindow.top;
     SetCapture( hwnd );
@@ -2020,21 +2021,20 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
 
     do
     {
-        GetMessage16( SEGPTR_GET(msg), 0, 0, 0 );
-	switch(msg->message)
+        if (!GetMessageW( &msg, 0, 0, 0 )) break;
+        if (CallMsgFilterW( &msg, MSGF_SCROLLBAR )) continue;
+	switch(msg.message)
 	{
 	case WM_LBUTTONUP:
 	case WM_MOUSEMOVE:
         case WM_SYSTIMER:
-            pt.x = LOWORD(msg->lParam) + wndPtr->rectClient.left - 
-	      wndPtr->rectWindow.left;
-            pt.y = HIWORD(msg->lParam) + wndPtr->rectClient.top - 
-	      wndPtr->rectWindow.top;
-            SCROLL_HandleScrollEvent( hwnd, scrollbar, msg->message, pt );
+            pt.x = LOWORD(msg.lParam) + wndPtr->rectClient.left - wndPtr->rectWindow.left;
+            pt.y = HIWORD(msg.lParam) + wndPtr->rectClient.top - wndPtr->rectWindow.top;
+            SCROLL_HandleScrollEvent( hwnd, scrollbar, msg.message, pt );
 	    break;
         default:
-            TranslateMessage16( msg );
-            DispatchMessage16( msg );
+            TranslateMessage( &msg );
+            DispatchMessageW( &msg );
             break;
 	}
         if (!IsWindow( hwnd ))
@@ -2042,8 +2042,7 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
             ReleaseCapture();
             break;
         }
-    } while (msg->message != WM_LBUTTONUP);
-    SEGPTR_FREE(msg);
+    } while (msg.message != WM_LBUTTONUP);
 END:
     WIN_ReleaseWndPtr(wndPtr);
 }