Ignore:
Timestamp:
Sep 4, 1999, 9:42:30 PM (26 years ago)
Author:
sandervl
Message:

Dialog changes

File:
1 edited

Legend:

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

    r760 r821  
    1 /* $Id: defwndproc.cpp,v 1.7 1999-08-31 17:14:51 sandervl Exp $ */
     1/* $Id: defwndproc.cpp,v 1.8 1999-09-04 19:42:27 sandervl Exp $ */
    22
    33/*
     
    1717#include "win32wnd.h"
    1818#include "win32wmdichild.h"
     19#include "win32dlg.h"
    1920
    2021#ifdef DEBUG
     
    5253LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    5354{
    54 #ifdef DEBUG
    55 ////    WriteLog("*DDP*");
    56 #endif
    57     switch(Msg) {
    58         case WM_SETREDRAW: //Open32 does not set the visible flag
    59                 if(wParam)
    60                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    61                 else
    62                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    63                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    64         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    65                 return(TRUE);
    66         case WM_CTLCOLORMSGBOX:
    67         case WM_CTLCOLOREDIT:
    68         case WM_CTLCOLORLISTBOX:
    69         case WM_CTLCOLORBTN:
    70         case WM_CTLCOLORDLG:
    71         case WM_CTLCOLORSTATIC:
    72         case WM_CTLCOLORSCROLLBAR:
    73                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    74                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    75                 return GetSysColorBrush(COLOR_BTNFACE);
     55  Win32Dialog *dialog;
    7656
    77     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    78         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     57    dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
     58    if(!dialog || dialog->IsWindow()) {
     59        dprintf(("DefDlgProcA, window %x not found", hwnd));
    7960        return 0;
    80 
    81         default:
    82                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    8361    }
     62    return dialog->DefDlgProcA(Msg, wParam, lParam);
    8463}
    8564//******************************************************************************
    86 //NOTE: Unicode msg translation!
    8765//******************************************************************************
    8866LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    8967{
    90 #ifdef DEBUG
    91 ////    WriteLog("*DDPW*");
    92 #endif
    93     switch(Msg) {
    94         case WM_SETREDRAW: //Open32 does not set the visible flag
    95                 if(wParam)
    96                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    97                 else
    98                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    99                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    100         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    101                 return(TRUE);
    102         case WM_CTLCOLORMSGBOX:
    103         case WM_CTLCOLOREDIT:
    104         case WM_CTLCOLORLISTBOX:
    105         case WM_CTLCOLORBTN:
    106         case WM_CTLCOLORDLG:
    107         case WM_CTLCOLORSTATIC:
    108         case WM_CTLCOLORSCROLLBAR:
    109                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    110                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    111                 return GetSysColorBrush(COLOR_BTNFACE);
     68  Win32Dialog *dialog;
    11269
    113     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    114         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     70    dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
     71    if(!dialog || dialog->IsWindow()) {
     72        dprintf(("DefDlgProcW, window %x not found", hwnd));
    11573        return 0;
    116 
    117         default:
    118                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    11974    }
     75    return dialog->DefDlgProcW(Msg, wParam, lParam);
    12076}
    12177//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.