Ignore:
Timestamp:
Sep 26, 1999, 6:09:04 PM (26 years ago)
Author:
dengert
Message:

SetTimer/KillTimer implemented

File:
1 edited

Legend:

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

    r949 r1066  
    1 /* $Id: oslibmsg.cpp,v 1.1 1999-09-15 23:18:54 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.2 1999-09-26 16:09:04 dengert Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    2222#include <win32wnd.h>
    2323#include "oslibutil.h"
     24#include "timer.h"
    2425
    2526QMSG *MsgThreadPtr = 0;
     
    2930BOOL OSLibInitMsgQueue()
    3031{
    31    if(DosAllocThreadLocalMemory(sizeof(QMSG)/sizeof(ULONG), (PULONG *)&MsgThreadPtr) != 0) 
     32   if(DosAllocThreadLocalMemory(sizeof(QMSG)/sizeof(ULONG), (PULONG *)&MsgThreadPtr) != 0)
    3233   {
    33         dprintf(("OSLibInitMsgQueue: local thread memory alloc failed!!"));
    34         DebugInt3();
    35         return FALSE;
     34        dprintf(("OSLibInitMsgQueue: local thread memory alloc failed!!"));
     35        DebugInt3();
     36        return FALSE;
    3637   }
    3738   return TRUE;
     
    7071//TODO: What to do if app changed msg? (translate)
    7172//  WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
    72  
     73
    7374  return (LONG)WinDispatchMsg(GetThreadHAB(), MsgThreadPtr);
    7475}
    7576//******************************************************************************
    7677//******************************************************************************
    77 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, 
     78BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
    7879                    BOOL isUnicode)
    7980{
    80  BOOL rc;
     81 BOOL rc, eaten;
    8182
    82   rc = WinGetMsg(GetThreadHAB(), MsgThreadPtr, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);
     83  do {
     84    eaten = FALSE;
     85    rc = WinGetMsg(GetThreadHAB(), MsgThreadPtr, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);
     86    if (MsgThreadPtr->msg == WM_TIMER)
     87      eaten = TIMER_HandleTimer (MsgThreadPtr);
     88  } while (eaten);
     89
    8390  OS2ToWinMsgTranslate(MsgThreadPtr, pMsg, isUnicode);
    8491  return rc;
     
    8693//******************************************************************************
    8794//******************************************************************************
    88 BOOL  OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, 
     95BOOL  OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
    8996                      BOOL fRemove, BOOL isUnicode)
    9097{
    9198 BOOL rc;
    9299
    93   rc = WinPeekMsg(GetThreadHAB(), MsgThreadPtr, hwnd, TranslateWinMsg(uMsgFilterMin), 
     100  rc = WinPeekMsg(GetThreadHAB(), MsgThreadPtr, hwnd, TranslateWinMsg(uMsgFilterMin),
    94101                  TranslateWinMsg(uMsgFilterMax), (fRemove == MSG_REMOVE) ? PM_REMOVE : PM_NOREMOVE);
    95102  OS2ToWinMsgTranslate(MsgThreadPtr, pMsg, isUnicode);
Note: See TracChangeset for help on using the changeset viewer.