Ignore:
Timestamp:
Jul 20, 1999, 9:42:36 AM (26 years ago)
Author:
sandervl
Message:

Accelerator support (not working) + bugfixes

File:
1 edited

Legend:

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

    r321 r342  
    1 /* $Id: oslibmsg.cpp,v 1.1 1999-07-17 11:52:22 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.2 1999-07-20 07:42:35 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    99 * Project Odin Software License can be found in LICENSE.TXT
    1010 *
    11  * TODO: Simply copy for now. Probably need to make a real translation
     11 * TODO: Simply copy for now. Need to make a real translation
    1212 *
    1313 */
    1414#define  INCL_WIN
    1515#define  INCL_PM
     16#define  INCL_DOSPROCESS
    1617#include <os2.h>
    1718#include <os2wrap.h>
     
    1920#include <misc.h>
    2021#include "oslibmsg.h"
     22#include <win32wnd.h>
     23#include "oslibutil.h"
    2124
     25QMSG *MsgThreadPtr = 0;
     26
     27//******************************************************************************
     28//******************************************************************************
     29BOOL OSLibInitMsgQueue()
     30{
     31   if(DosAllocThreadLocalMemory(sizeof(QMSG)/sizeof(ULONG), (PULONG *)&MsgThreadPtr) != 0)
     32   {
     33        dprintf(("OSLibInitMsgQueue: local thread memory alloc failed!!"));
     34        DebugInt3();
     35        return FALSE;
     36   }
     37   return TRUE;
     38}
    2239//******************************************************************************
    2340//******************************************************************************
     
    3249{
    3350  memcpy(winMsg, os2Msg, sizeof(MSG));
     51  winMsg->hwnd = Win32Window::OS2ToWin32Handle(os2Msg->hwnd);
    3452}
    3553//******************************************************************************
     
    4260//******************************************************************************
    4361//******************************************************************************
     62void OSLibWinPostQuitMessage(ULONG nExitCode)
     63{
     64  WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0);
     65}
     66//******************************************************************************
     67//******************************************************************************
     68LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)
     69{
     70//TODO: What to do if app changed msg? (translate)
     71//  WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
     72 
     73  return (LONG)WinDispatchMsg(GetThreadHAB(), MsgThreadPtr);
     74}
     75//******************************************************************************
     76//******************************************************************************
     77BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode)
     78{
     79 BOOL rc;
     80
     81  rc = WinGetMsg(GetThreadHAB(), MsgThreadPtr, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);
     82  OS2ToWinMsgTranslate(MsgThreadPtr, pMsg, isUnicode);
     83  return rc;
     84}
     85//******************************************************************************
     86//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.