Ignore:
Timestamp:
Aug 31, 1999, 7:14:52 PM (26 years ago)
Author:
sandervl
Message:

MDI + menu changes

File:
1 edited

Legend:

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

    r741 r760  
    1 /* $Id: defwndproc.cpp,v 1.6 1999-08-30 11:59:53 sandervl Exp $ */
     1/* $Id: defwndproc.cpp,v 1.7 1999-08-31 17:14:51 sandervl Exp $ */
    22
    33/*
     
    1616#include "win32wbase.h"
    1717#include "win32wnd.h"
     18#include "win32wmdichild.h"
    1819
    1920#ifdef DEBUG
     
    148149LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    149150{
    150 #ifdef DEBUG
    151 ////    WriteLog("*DMP*");
    152 #endif
    153     switch(Msg) {
    154         case WM_SETREDRAW: //Open32 does not set the visible flag
    155                 if(wParam)
    156                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    157                 else
    158                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    159                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    160         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    161                 return(TRUE);
    162         case WM_CTLCOLORMSGBOX:
    163         case WM_CTLCOLOREDIT:
    164         case WM_CTLCOLORLISTBOX:
    165         case WM_CTLCOLORBTN:
    166         case WM_CTLCOLORDLG:
    167         case WM_CTLCOLORSTATIC:
    168         case WM_CTLCOLORSCROLLBAR:
    169                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    170                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    171                 return GetSysColorBrush(COLOR_BTNFACE);
     151  Win32MDIChildWindow *window;
    172152
    173     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    174         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     153    window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd);
     154    if(!window) {
     155        dprintf(("DefMDIProcA, window %x not found", hwnd));
    175156        return 0;
    176 
    177         default:
    178                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    179157    }
     158    return window->DefMDIChildProcA(Msg, wParam, lParam);
    180159}
    181160//******************************************************************************
    182 //NOTE: Unicode msg translation!
    183161//******************************************************************************
    184162LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    185163{
    186 #ifdef DEBUG
    187 ////    WriteLog("*DMPW*");
    188 #endif
    189     switch(Msg) {
    190         case WM_SETREDRAW: //Open32 does not set the visible flag
    191                 if(wParam)
    192                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    193                 else
    194                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    195                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    196         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    197                 return(TRUE);
    198         case WM_CTLCOLORMSGBOX:
    199         case WM_CTLCOLOREDIT:
    200         case WM_CTLCOLORLISTBOX:
    201         case WM_CTLCOLORBTN:
    202         case WM_CTLCOLORDLG:
    203         case WM_CTLCOLORSTATIC:
    204         case WM_CTLCOLORSCROLLBAR:
    205                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    206                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    207                 return GetSysColorBrush(COLOR_BTNFACE);
     164  Win32MDIChildWindow *window;
    208165
    209     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    210         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     166    window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd);
     167    if(!window) {
     168        dprintf(("DefMDIProcW, window %x not found", hwnd));
    211169        return 0;
    212 
    213         default:
    214                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    215170    }
     171    return window->DefMDIChildProcW(Msg, wParam, lParam);
    216172}
    217173//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.