Ignore:
Timestamp:
May 25, 2001, 9:59:30 PM (24 years ago)
Author:
sandervl
Message:

Post(Thread)/SendMessage updates & fixes

File:
1 edited

Legend:

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

    r5606 r5805  
    1 /* $Id: oslibmsg.cpp,v 1.37 2001-04-27 17:36:37 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.38 2001-05-25 19:59:29 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    128128
    129129    if(msg >= WINWM_USER)
    130         return WIN32APP_POSTMSG;
     130        return msg + WIN32APP_POSTMSG;
    131131
    132132    for(int i=0;i<MAX_MSGTRANSTAB;i++)
     
    143143    }
    144144
    145     //not found, probaby WIN32APP_POSTMSG
    146     return WIN32APP_POSTMSG;
     145    //not found, get everything
     146    dprintf(("WARNING: TranslateWinMsg: message %x not found", msg));
     147    return 0;
    147148}
    148149//******************************************************************************
     
    351352
    352353  if(rc == FALSE) {
    353     return FALSE;
     354      return FALSE;
    354355  }
    355356
     
    358359     //unused PM message; dispatch immediately and grab next one
    359360     dprintf2(("OSLibWinPeekMsg: Untranslated message; dispatched immediately"));
    360      rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
    361                      TranslateWinMsg(uMsgFilterMax, FALSE), PM_REMOVE);
     361     if(!(fRemove & PM_REMOVE_W)) {
     362         rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
     363                         TranslateWinMsg(uMsgFilterMax, FALSE), PM_REMOVE);
     364     }
    362365     WinDispatchMsg(teb->o.odin.hab, &os2msg);
    363366     return OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax,
     
    454457 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    455458
    456     packet->Msg    = msg;
    457     packet->wParam = wParam;
    458     packet->lParam = lParam;
    459 
    460     return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
     459    packet->wParam   = wParam;
     460    packet->lParam   = lParam;
     461
     462    return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
    461463}
    462464//******************************************************************************
     
    464466ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend)
    465467{
    466     return WinBroadcastMsg(HWND_DESKTOP, msg, (MPARAM)wParam, (MPARAM)lParam,
     468    return WinBroadcastMsg(HWND_DESKTOP, WIN32APP_POSTMSG+msg, (MPARAM)wParam, (MPARAM)lParam,
    467469                           (fSend) ? BMSG_SEND : BMSG_POST);
    468470}
     
    473475 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    474476
    475     packet->Msg = msg;
    476     packet->wParam = wParam;
    477     packet->lParam = lParam;
    478     return WinPostMsg(hwnd, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
     477    packet->wParam   = wParam;
     478    packet->lParam   = lParam;
     479    return WinPostMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
    479480}
    480481//******************************************************************************
     
    509510//    }
    510511    dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam));
    511     packet->Msg = msg;
    512     packet->wParam = wParam;
    513     packet->lParam = lParam;
    514     return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet);
    515 }
    516 //******************************************************************************
    517 //******************************************************************************
    518 
     512    packet->wParam   = wParam;
     513    packet->lParam   = lParam;
     514    return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF+msg, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet);
     515}
     516//******************************************************************************
     517//******************************************************************************
     518
Note: See TracChangeset for help on using the changeset viewer.