Ignore:
Timestamp:
Jan 11, 2000, 12:29:16 AM (26 years ago)
Author:
sandervl
Message:

get/peekmessage fixes, timer fix, (user/new) replaced wm_hittest code; added wm_ncactivate, changed system menu

File:
1 edited

Legend:

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

    r2381 r2400  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.9 2000-01-09 14:14:23 cbratschi Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.10 2000-01-10 23:29:12 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    133133  POSTMSG_PACKET  *packet;
    134134  THDB            *thdb = (THDB *)pThdb;
     135  ULONG            hittest;
    135136  int i;
    136137
     
    138139  win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(os2Msg->hwnd);
    139140  if (!win32wnd) win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(os2Msg->hwnd);
     141
    140142  //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle
    141   if(win32wnd == 0 && (os2Msg->msg != WM_CREATE && os2Msg->msg != WM_QUIT && os2Msg->msg != WIN32APP_POSTMSG))
     143  //Realplayer starts a timer with hwnd 0 & proc 0; check this here
     144  if(win32wnd == 0 && (os2Msg->msg != WM_CREATE && os2Msg->msg != WM_QUIT && os2Msg->msg != WM_TIMER && os2Msg->msg != WIN32APP_POSTMSG))
    142145  {
    143146        goto dummymessage; //not a win32 client window
     
    167170      case WM_BUTTON3DBLCLK:
    168171        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
     172
     173        hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
     174
    169175        if (IsNCMouseMsg(win32wnd)) {
    170176            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    171             winMsg->wParam  = win32wnd->lastHitTestVal;
     177            winMsg->wParam  = hittest;
    172178            winMsg->lParam  = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates
    173179        }
     
    199205      {
    200206        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    201         if(IsNCMouseMsg(win32wnd))
     207        hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
     208
     209        if (IsNCMouseMsg(win32wnd))
    202210        {
    203211          winMsg->message = WINWM_NCMOUSEMOVE;
    204           winMsg->wParam  = (WPARAM)win32wnd->lastHitTestVal;
     212          winMsg->wParam  = (WPARAM)hittest;
    205213          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    206         } else
     214        }
     215        else
    207216        {
    208217          winMsg->message = WINWM_MOUSEMOVE;
     
    220229      }
    221230
    222       case WM_HITTEST:
     231      case WM_ACTIVATE:
    223232      {
    224         winMsg->message  = WINWM_NCHITTEST;
    225         winMsg->wParam  = 0;
    226         winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    227         return TRUE;
     233        winMsg->message = WINWM_NCACTIVATE;
     234        winMsg->wParam  = SHORT1FROMMP(os2Msg->mp1);
     235        return TRUE;
    228236      }
     237
    229238    }
    230239    //do normal translation for all other messages
     
    346355    case WM_BUTTON3DBLCLK:
    347356        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
     357        hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
     358
    348359        if(IsNCMouseMsg(win32wnd)) {
    349360            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    350             winMsg->wParam  = win32wnd->lastHitTestVal;
     361            winMsg->wParam  = hittest;
    351362            winMsg->lParam  = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates
    352363        }
     
    378389    {
    379390        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
     391        hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
     392
    380393        if(IsNCMouseMsg(win32wnd))
    381394        {
    382395          winMsg->message = WINWM_NCMOUSEMOVE;
    383           winMsg->wParam  = (WPARAM)win32wnd->lastHitTestVal;
     396          winMsg->wParam  = (WPARAM)hittest;
    384397          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    385398        } else
     
    578591
    579592        if(wndParams->fsStatus & WPM_TEXT) {
    580             win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText);
     593            winMsg->message = WINWM_SETTEXT;
     594            winMsg->lParam  = (LPARAM)wndParams->pszText;
    581595            break;
    582596        }
     
    612626        }
    613627        else    winMsg->message = WINWM_PAINT;
    614         break;
    615     }
    616 
    617     case WM_HITTEST:
    618     {
    619         winMsg->message  = WINWM_NCHITTEST;
    620         winMsg->wParam  = 0;
    621         winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    622628        break;
    623629    }
Note: See TracChangeset for help on using the changeset viewer.