| 1 | /* $Id: defwndproc.cpp,v 1.10 1999-10-08 19:46:54 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Win32 default window API functions for OS/2 | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright 1998 Sander van Leeuwen | 
|---|
| 7 | * | 
|---|
| 8 | * | 
|---|
| 9 | * TODO: Incomplete default window handlers + incorrect handler (defframe) | 
|---|
| 10 | * | 
|---|
| 11 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 12 | * | 
|---|
| 13 | */ | 
|---|
| 14 | #include "user32.h" | 
|---|
| 15 | #include "syscolor.h" | 
|---|
| 16 | #include "win32wbase.h" | 
|---|
| 17 | #include "win32wnd.h" | 
|---|
| 18 | #include "win32wmdichild.h" | 
|---|
| 19 | #include "win32dlg.h" | 
|---|
| 20 |  | 
|---|
| 21 | #ifdef DEBUG | 
|---|
| 22 | char *GetMsgText(int Msg); | 
|---|
| 23 | #endif | 
|---|
| 24 |  | 
|---|
| 25 | //****************************************************************************** | 
|---|
| 26 | //****************************************************************************** | 
|---|
| 27 | LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 28 | { | 
|---|
| 29 | Win32BaseWindow *window; | 
|---|
| 30 |  | 
|---|
| 31 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 32 | if(!window) { | 
|---|
| 33 | dprintf(("DefWindowProcA, window %x not found", hwnd)); | 
|---|
| 34 | return 0; | 
|---|
| 35 | } | 
|---|
| 36 | return window->DefWindowProcA(Msg, wParam, lParam); | 
|---|
| 37 | } | 
|---|
| 38 | //****************************************************************************** | 
|---|
| 39 | //****************************************************************************** | 
|---|
| 40 | LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 41 | { | 
|---|
| 42 | Win32BaseWindow *window; | 
|---|
| 43 |  | 
|---|
| 44 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 45 | if(!window) { | 
|---|
| 46 | dprintf(("DefWindowProcW, window %x not found", hwnd)); | 
|---|
| 47 | return 0; | 
|---|
| 48 | } | 
|---|
| 49 | return window->DefWindowProcW(Msg, wParam, lParam); | 
|---|
| 50 | } | 
|---|
| 51 | //****************************************************************************** | 
|---|
| 52 | //****************************************************************************** | 
|---|
| 53 | LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 54 | { | 
|---|
| 55 | Win32Dialog *dialog; | 
|---|
| 56 |  | 
|---|
| 57 | dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 58 | //TODO: Wrong check? | 
|---|
| 59 | //    if(!dialog || !dialog->IsDialog()) { | 
|---|
| 60 | if(!dialog) { | 
|---|
| 61 | dprintf(("DefDlgProcA, window %x not found", hwnd)); | 
|---|
| 62 | return 0; | 
|---|
| 63 | } | 
|---|
| 64 | if(dialog->IsDialog()) | 
|---|
| 65 | return dialog->DefDlgProcA(Msg, wParam, lParam); | 
|---|
| 66 | else return dialog->DefWindowProcA(Msg, wParam, lParam); | 
|---|
| 67 | } | 
|---|
| 68 | //****************************************************************************** | 
|---|
| 69 | //****************************************************************************** | 
|---|
| 70 | LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 71 | { | 
|---|
| 72 | Win32Dialog *dialog; | 
|---|
| 73 |  | 
|---|
| 74 | dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 75 | //TODO: Wrong check? | 
|---|
| 76 | //    if(!dialog || !dialog->IsDialog()) { | 
|---|
| 77 | if(!dialog) { | 
|---|
| 78 | dprintf(("DefDlgProcW, window %x not found", hwnd)); | 
|---|
| 79 | return 0; | 
|---|
| 80 | } | 
|---|
| 81 | if(dialog->IsDialog()) | 
|---|
| 82 | return dialog->DefDlgProcW(Msg, wParam, lParam); | 
|---|
| 83 | else return dialog->DefWindowProcW(Msg, wParam, lParam); | 
|---|
| 84 | } | 
|---|
| 85 | //****************************************************************************** | 
|---|
| 86 | //****************************************************************************** | 
|---|
| 87 | LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 88 | { | 
|---|
| 89 | Win32Window *window; | 
|---|
| 90 |  | 
|---|
| 91 | window = (Win32Window *)Win32BaseWindow::GetWindowFromHandle(hwndFrame); | 
|---|
| 92 | if(!window) { | 
|---|
| 93 | dprintf(("DefFrameProcA, window %x not found", hwndFrame)); | 
|---|
| 94 | return 0; | 
|---|
| 95 | } | 
|---|
| 96 | return window->DefFrameProcA(hwndMDIClient, Msg, wParam, lParam); | 
|---|
| 97 | } | 
|---|
| 98 | //****************************************************************************** | 
|---|
| 99 | //****************************************************************************** | 
|---|
| 100 | LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 101 | { | 
|---|
| 102 | Win32Window *window; | 
|---|
| 103 |  | 
|---|
| 104 | window = (Win32Window *)Win32BaseWindow::GetWindowFromHandle(hwndFrame); | 
|---|
| 105 | if(!window) { | 
|---|
| 106 | dprintf(("DefFrameProcW, window %x not found", hwndFrame)); | 
|---|
| 107 | return 0; | 
|---|
| 108 | } | 
|---|
| 109 | return window->DefFrameProcW(hwndMDIClient, Msg, wParam, lParam); | 
|---|
| 110 | } | 
|---|
| 111 | //****************************************************************************** | 
|---|
| 112 | //****************************************************************************** | 
|---|
| 113 | LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 114 | { | 
|---|
| 115 | Win32MDIChildWindow *window; | 
|---|
| 116 |  | 
|---|
| 117 | window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 118 | if(!window) { | 
|---|
| 119 | dprintf(("DefMDIProcA, window %x not found", hwnd)); | 
|---|
| 120 | return 0; | 
|---|
| 121 | } | 
|---|
| 122 | return window->DefMDIChildProcA(Msg, wParam, lParam); | 
|---|
| 123 | } | 
|---|
| 124 | //****************************************************************************** | 
|---|
| 125 | //****************************************************************************** | 
|---|
| 126 | LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) | 
|---|
| 127 | { | 
|---|
| 128 | Win32MDIChildWindow *window; | 
|---|
| 129 |  | 
|---|
| 130 | window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 131 | if(!window) { | 
|---|
| 132 | dprintf(("DefMDIProcW, window %x not found", hwnd)); | 
|---|
| 133 | return 0; | 
|---|
| 134 | } | 
|---|
| 135 | return window->DefMDIChildProcW(Msg, wParam, lParam); | 
|---|
| 136 | } | 
|---|
| 137 | //****************************************************************************** | 
|---|
| 138 | //****************************************************************************** | 
|---|