Ignore:
Timestamp:
Apr 27, 2001, 7:36:39 PM (24 years ago)
Author:
sandervl
Message:

mouse message translation + dc reset after resize fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/windowmsg.cpp

    r5373 r5606  
    1 /* $Id: windowmsg.cpp,v 1.23 2001-03-25 08:50:42 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.24 2001-04-27 17:36:39 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    2424#include "oslibwin.h"
    2525#include "oslibmsg.h"
     26#include "hook.h"
    2627
    2728#define DBG_LOCALLOG    DBG_windowmsg
     
    3940LONG WIN32API DispatchMessageA(const MSG * msg)
    4041{
     42  dprintf2(("DispatchMessageA %x %x %x %x %x", msg->hwnd, msg->message, msg->wParam, msg->lParam, msg->time));
    4143  return OSLibWinDispatchMsg((MSG *)msg);
    4244}
     
    4547LONG WIN32API DispatchMessageW( const MSG * msg)
    4648{
     49  dprintf2(("DispatchMessageW %x %x %x %x %x", msg->hwnd, msg->message, msg->wParam, msg->lParam, msg->time));
    4750  return OSLibWinDispatchMsg((MSG *)msg, TRUE);
    4851}
     
    5760BOOL WIN32API GetMessageA( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
    5861{
    59     return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax);
     62  BOOL ret;
     63
     64    dprintf2(("GetMessageA %x %d-%d %d", hwnd, uMsgFilterMin, uMsgFilterMax));
     65    ret = OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax);
     66    HOOK_CallHooksA(WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)pMsg);
     67    return ret;
    6068}
    6169//******************************************************************************
     
    6371BOOL WIN32API GetMessageW( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
    6472{
    65     return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE);
     73  BOOL ret;
     74
     75    dprintf2(("GetMessageW %x %d-%d %d", hwnd, uMsgFilterMin, uMsgFilterMax));
     76    ret = OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE);
     77    HOOK_CallHooksW(WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)pMsg);
     78    return ret;
    6679}
    6780//******************************************************************************
     
    7184{
    7285 BOOL fFoundMsg;
    73 
     86 
     87    dprintf2(("PeekMessagA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));
    7488    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
    7589                                fuRemoveMsg, FALSE);
    7690    if(fFoundMsg) {
     91        dprintf2(("PeekMessagA %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam));
     92        HOOK_CallHooksA(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg );
    7793        if (msg->message == WM_QUIT && (fuRemoveMsg & PM_REMOVE)) {
    7894            //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down
     
    88104 BOOL fFoundMsg;
    89105
     106    dprintf2(("PeekMessagW %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));
    90107    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
    91108                                fuRemoveMsg, FALSE);
    92109    if(fFoundMsg) {
     110        dprintf2(("PeekMessagW %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam));
     111        HOOK_CallHooksW(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg );
    93112        if (msg->message == WM_QUIT && (fuRemoveMsg & (PM_REMOVE))) {
    94113            //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down
     
    109128DWORD WIN32API GetMessagePos(void)
    110129{
    111     dprintf(("USER32: GetMessagePos"));
    112     return OSLibWinGetMessagePos();
     130 DWORD pos;
     131
     132    pos = OSLibWinGetMessagePos();
     133    dprintf(("USER32: GetMessagePos -> (%d,%d)", HIWORD(pos), LOWORD(pos)));
     134    return pos;
    113135}
    114136//******************************************************************************
     
    9941016 DWORD queueStatus;
    9951017
    996     dprintf(("USER32:  GetQueueStatus"));
    9971018    queueStatus = OSLibWinQueryQueueStatus();
    998 
    9991019    queueStatus = MAKELONG(queueStatus, queueStatus);
     1020
     1021    dprintf(("USER32: GetQueueStatus %x returned %x", flags, queueStatus & MAKELONG(flags, flags)));
     1022
    10001023    return queueStatus & MAKELONG(flags, flags);
    10011024}
     
    10321055{
    10331056 DWORD curtime, endtime;
     1057 MSG msg;
    10341058
    10351059  dprintf(("MsgWaitForMultipleObjects %x %x %d %d %x", nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask));
     
    10511075                if(OSLibWinWaitMessage() == FALSE) {
    10521076                        dprintf(("OSLibWinWaitMessage returned FALSE!"));
    1053                         return -1;
     1077                        return WAIT_ABANDONED;
    10541078                }
    10551079                if(GetQueueStatus(dwWakeMask) != 0) {
    10561080                        return WAIT_OBJECT_0;
    10571081                }
     1082                //TODO: Ignoring all messages could be dangerous. But processing them,
     1083                //while the app doesn't expect any, isn't safe either.
     1084                if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
     1085                {
     1086                    if (msg.message == WM_QUIT) {
     1087                         dprintf(("ERROR: MsgWaitForMultipleObjects call abandoned because WM_QUIT msg was received!!"));
     1088                         return WAIT_ABANDONED;
     1089                    }
     1090   
     1091                    /* otherwise dispatch it */
     1092                    DispatchMessageA(&msg);
     1093                }
    10581094                curtime = GetCurrentTime();
    10591095        }
Note: See TracChangeset for help on using the changeset viewer.