Ignore:
Timestamp:
Aug 29, 1999, 10:05:08 PM (26 years ago)
Author:
sandervl
Message:

Mouse message handling changes

File:
1 edited

Legend:

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

    r392 r740  
    1 /* $Id: defwndproc.cpp,v 1.4 1999-07-25 15:51:55 sandervl Exp $ */
     1/* $Id: defwndproc.cpp,v 1.5 1999-08-29 20:05:07 sandervl Exp $ */
    22
    33/*
     
    66 * Copyright 1998 Sander van Leeuwen
    77 *
     8 *
     9 * TODO: Incomplete default window handlers + incorrect handler (defframe)
    810 *
    911 * Project Odin Software License can be found in LICENSE.TXT
     
    116118}
    117119//******************************************************************************
     120//TODO: Should be handled differently than the normal wnd proc
    118121//******************************************************************************
    119122LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
    120123{
    121 #ifdef DEBUG
    122 ////    WriteLog("*DFP*");
    123 #endif
    124     switch(Msg) {
    125         case WM_SETREDRAW: //Open32 does not set the visible flag
    126                 if(wParam)
    127                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
    128                 else
    129                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
    130                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    131         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    132                 return(TRUE);
    133         case WM_CTLCOLORMSGBOX:
    134         case WM_CTLCOLOREDIT:
    135         case WM_CTLCOLORLISTBOX:
    136         case WM_CTLCOLORBTN:
    137         case WM_CTLCOLORDLG:
    138         case WM_CTLCOLORSTATIC:
    139         case WM_CTLCOLORSCROLLBAR:
    140                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    141                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    142                 return GetSysColorBrush(COLOR_BTNFACE);
    143 
    144     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    145         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
    146         return 0;
    147 
    148         default:
    149                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
     124  Win32Window *window;
     125
     126    window = Win32Window::GetWindowFromHandle(hwndFrame);
     127    if(!window) {
     128        dprintf(("DefFrameProcA, window %x not found", hwndFrame));
     129        return 0;
     130    }
     131    return window->DefWindowProcA(Msg, wParam, lParam);
     132}
     133//******************************************************************************
     134//TODO: Should be handled differently than the normal wnd proc
     135//******************************************************************************
     136LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
     137{
     138  Win32Window *window;
     139
     140    window = Win32Window::GetWindowFromHandle(hwndFrame);
     141    if(!window) {
     142        dprintf(("DefFrameProcW, window %x not found", hwndFrame));
     143        return 0;
     144    }
     145    return window->DefWindowProcW(Msg, wParam, lParam);
     146}
     147//******************************************************************************
     148//******************************************************************************
     149LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
     150{
     151#ifdef DEBUG
     152////    WriteLog("*DMP*");
     153#endif
     154    switch(Msg) {
     155        case WM_SETREDRAW: //Open32 does not set the visible flag
     156                if(wParam)
     157                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
     158                else
     159                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
     160                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
     161        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
     162                return(TRUE);
     163        case WM_CTLCOLORMSGBOX:
     164        case WM_CTLCOLOREDIT:
     165        case WM_CTLCOLORLISTBOX:
     166        case WM_CTLCOLORBTN:
     167        case WM_CTLCOLORDLG:
     168        case WM_CTLCOLORSTATIC:
     169        case WM_CTLCOLORSCROLLBAR:
     170                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     171                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     172                return GetSysColorBrush(COLOR_BTNFACE);
     173
     174    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
     175        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     176        return 0;
     177
     178        default:
     179                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    150180    }
    151181}
     
    153183//NOTE: Unicode msg translation!
    154184//******************************************************************************
    155 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
    156 {
    157 #ifdef DEBUG
    158 ////    WriteLog("*DFPW*");
    159 #endif
    160     switch(Msg) {
    161         case WM_SETREDRAW: //Open32 does not set the visible flag
    162                 if(wParam)
    163                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
    164                 else
    165                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
    166                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    167         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    168                 return(TRUE);
    169         case WM_CTLCOLORMSGBOX:
    170         case WM_CTLCOLOREDIT:
    171         case WM_CTLCOLORLISTBOX:
    172         case WM_CTLCOLORBTN:
    173         case WM_CTLCOLORDLG:
    174         case WM_CTLCOLORSTATIC:
    175         case WM_CTLCOLORSCROLLBAR:
    176                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    177                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    178                 return GetSysColorBrush(COLOR_BTNFACE);
    179 
    180     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    181         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
    182         return 0;
    183 
    184         default:
    185                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    186     }
    187 }
    188 //******************************************************************************
    189 //******************************************************************************
    190 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    191 {
    192 #ifdef DEBUG
    193 ////    WriteLog("*DMP*");
    194 #endif
    195     switch(Msg) {
    196         case WM_SETREDRAW: //Open32 does not set the visible flag
    197                 if(wParam)
    198                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    199                 else
    200                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    201                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    202         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    203                 return(TRUE);
    204         case WM_CTLCOLORMSGBOX:
    205         case WM_CTLCOLOREDIT:
    206         case WM_CTLCOLORLISTBOX:
    207         case WM_CTLCOLORBTN:
    208         case WM_CTLCOLORDLG:
    209         case WM_CTLCOLORSTATIC:
    210         case WM_CTLCOLORSCROLLBAR:
    211                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    212                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    213                 return GetSysColorBrush(COLOR_BTNFACE);
    214 
    215     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    216         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
    217         return 0;
    218 
    219         default:
    220                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    221     }
    222 }
    223 //******************************************************************************
    224 //NOTE: Unicode msg translation!
    225 //******************************************************************************
    226185LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    227186{
Note: See TracChangeset for help on using the changeset viewer.