Changeset 3274 for trunk/src


Ignore:
Timestamp:
Mar 29, 2000, 7:16:06 PM (25 years ago)
Author:
sandervl
Message:

Peek/GetMessage bugfixes

Location:
trunk/src/user32
Files:
2 edited

Legend:

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

    r3101 r3274  
    1 /* $Id: oslibmsg.cpp,v 1.30 2000-03-13 13:10:46 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.31 2000-03-29 17:16:06 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    2525#include "oslibmsg.h"
    2626#include <winconst.h>
     27#include <win32api.h>
    2728#include <win32wnd.h>
    2829#include "oslibutil.h"
     
    204205 THDB *thdb;
    205206 QMSG  os2msg;
     207 HWND  hwndOS2 = 0;
     208
     209  if(hwnd) {
     210        hwndOS2 = Win32BaseWindow::Win32ToOS2Handle(hwnd);
     211        if(hwndOS2 == NULL) {
     212                memset(pMsg, 0, sizeof(MSG));
     213                dprintf(("GetMsg: window %x NOT FOUND!", hwnd));
     214                SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     215                return TRUE;
     216        }
     217  }
    206218
    207219  thdb = GetThreadTHDB();
    208220  if(thdb == NULL) {
    209221        DebugInt3();
    210         return FALSE;
     222        return TRUE;
    211223  }
    212224
     
    275287 THDB *thdb;
    276288 QMSG  os2msg;
     289 HWND  hwndOS2 = 0;
     290
     291  if(hwnd && hwnd != -1) {
     292        hwndOS2 = Win32BaseWindow::Win32ToOS2Handle(hwnd);
     293        if(hwndOS2 == NULL) {
     294                dprintf(("PeekMsg: window %x NOT FOUND!", hwnd));
     295                SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
     296                return FALSE;
     297        }
     298  }
    277299
    278300  thdb = GetThreadTHDB();
     
    304326  do {
    305327        eaten = FALSE;
    306         rc = WinPeekMsg(thdb->hab, &os2msg, Win32BaseWindow::OS2ToWin32Handle(hwnd), TranslateWinMsg(uMsgFilterMin, TRUE),
     328        rc = WinPeekMsg(thdb->hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
    307329                        TranslateWinMsg(uMsgFilterMax, FALSE), (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
    308330
  • trunk/src/user32/windowmsg.cpp

    r3209 r3274  
    1 /* $Id: windowmsg.cpp,v 1.20 2000-03-23 23:06:53 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.21 2000-03-29 17:16:06 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    7272 BOOL fFoundMsg;
    7373
    74     fFoundMsg = OSLibWinPeekMsg(msg, 0, uMsgFilterMin, uMsgFilterMax,
     74    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
    7575                                fuRemoveMsg, FALSE);
    7676    if(fFoundMsg) {
     
    8888 BOOL fFoundMsg;
    8989
    90     fFoundMsg = OSLibWinPeekMsg(msg, 0, uMsgFilterMin, uMsgFilterMax,
     90    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
    9191                                fuRemoveMsg, FALSE);
    9292    if(fFoundMsg) {
Note: See TracChangeset for help on using the changeset viewer.