Replaced MSG_InternalGetMessage calls by equivalent exported APIs.
diff --git a/controls/menu.c b/controls/menu.c
index 0bc988b..7608eca 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -2655,13 +2655,29 @@
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 70961ed..daed7d0 100644
--- a/dlls/x11drv/winpos.c
+++ b/dlls/x11drv/winpos.c
@@ -1596,8 +1596,9 @@
{
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 @@
{
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 449b016..e76ab26 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 @@
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 @@
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 287c6fb..21bd53d 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 @@
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 @@
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 @@
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 @@
*/
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 @@
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 @@
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 @@
ReleaseCapture();
break;
}
- } while (msg->message != WM_LBUTTONUP);
- SEGPTR_FREE(msg);
+ } while (msg.message != WM_LBUTTONUP);
END:
WIN_ReleaseWndPtr(wndPtr);
}