Replaced MSG_InternalGetMessage calls by equivalent exported APIs.

This commit is contained in:
Alexandre Julliard 2001-08-06 18:05:47 +00:00
parent 4de0df77cf
commit bfb4a23aa9
4 changed files with 60 additions and 33 deletions

View File

@ -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)

View File

@ -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) ||

View File

@ -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,

View File

@ -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);
}