1 | /* $Id: defwndproc.cpp,v 1.13 2000-02-16 14:34:15 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 | #define DBG_LOCALLOG DBG_defwndproc
|
---|
22 | #include "dbglocal.h"
|
---|
23 |
|
---|
24 | #ifdef DEBUG
|
---|
25 | char *GetMsgText(int Msg);
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | //******************************************************************************
|
---|
29 | //******************************************************************************
|
---|
30 | LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
31 | {
|
---|
32 | Win32BaseWindow *window;
|
---|
33 |
|
---|
34 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
35 | if(!window) {
|
---|
36 | dprintf(("DefWindowProcA, window %x not found", hwnd));
|
---|
37 | return 0;
|
---|
38 | }
|
---|
39 | return window->DefWindowProcA(Msg, wParam, lParam);
|
---|
40 | }
|
---|
41 | //******************************************************************************
|
---|
42 | //******************************************************************************
|
---|
43 | LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
44 | {
|
---|
45 | Win32BaseWindow *window;
|
---|
46 |
|
---|
47 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
48 | if(!window) {
|
---|
49 | dprintf(("DefWindowProcW, window %x not found", hwnd));
|
---|
50 | return 0;
|
---|
51 | }
|
---|
52 | return window->DefWindowProcW(Msg, wParam, lParam);
|
---|
53 | }
|
---|
54 | //******************************************************************************
|
---|
55 | //******************************************************************************
|
---|
56 | LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
57 | {
|
---|
58 | Win32Dialog *dialog;
|
---|
59 |
|
---|
60 | dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
61 | //TODO: Wrong check?
|
---|
62 | // if(!dialog || !dialog->IsDialog()) {
|
---|
63 | if(!dialog) {
|
---|
64 | dprintf(("DefDlgProcA, window %x not found", hwnd));
|
---|
65 | return 0;
|
---|
66 | }
|
---|
67 | if(dialog->IsDialog())
|
---|
68 | return dialog->DefDlgProcA(Msg, wParam, lParam);
|
---|
69 | else return dialog->DefWindowProcA(Msg, wParam, lParam);
|
---|
70 | }
|
---|
71 | //******************************************************************************
|
---|
72 | //******************************************************************************
|
---|
73 | LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
74 | {
|
---|
75 | Win32Dialog *dialog;
|
---|
76 |
|
---|
77 | dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
78 | //TODO: Wrong check?
|
---|
79 | // if(!dialog || !dialog->IsDialog()) {
|
---|
80 | if(!dialog) {
|
---|
81 | dprintf(("DefDlgProcW, window %x not found", hwnd));
|
---|
82 | return 0;
|
---|
83 | }
|
---|
84 | if(dialog->IsDialog())
|
---|
85 | return dialog->DefDlgProcW(Msg, wParam, lParam);
|
---|
86 | else return dialog->DefWindowProcW(Msg, wParam, lParam);
|
---|
87 | }
|
---|
88 | //******************************************************************************
|
---|
89 | //******************************************************************************
|
---|
90 | LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
91 | {
|
---|
92 | Win32Window *window;
|
---|
93 |
|
---|
94 | window = (Win32Window *)Win32BaseWindow::GetWindowFromHandle(hwndFrame);
|
---|
95 | if(!window) {
|
---|
96 | dprintf(("DefFrameProcA, window %x not found", hwndFrame));
|
---|
97 | return 0;
|
---|
98 | }
|
---|
99 | return window->DefFrameProcA(hwndMDIClient, Msg, wParam, lParam);
|
---|
100 | }
|
---|
101 | //******************************************************************************
|
---|
102 | //******************************************************************************
|
---|
103 | LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
104 | {
|
---|
105 | Win32Window *window;
|
---|
106 |
|
---|
107 | window = (Win32Window *)Win32BaseWindow::GetWindowFromHandle(hwndFrame);
|
---|
108 | if(!window) {
|
---|
109 | dprintf(("DefFrameProcW, window %x not found", hwndFrame));
|
---|
110 | return 0;
|
---|
111 | }
|
---|
112 | return window->DefFrameProcW(hwndMDIClient, Msg, wParam, lParam);
|
---|
113 | }
|
---|
114 | //******************************************************************************
|
---|
115 | //******************************************************************************
|
---|
116 | LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
117 | {
|
---|
118 | Win32MDIChildWindow *window;
|
---|
119 |
|
---|
120 | window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
121 | if(!window) {
|
---|
122 | dprintf(("DefMDIProcA, window %x not found", hwnd));
|
---|
123 | return 0;
|
---|
124 | }
|
---|
125 | if(!window->isMDIChild()) {
|
---|
126 | dprintf(("App called DefMDIChildProcA for non-MDI window %x", hwnd));
|
---|
127 | return window->DefWindowProcA(Msg, wParam, lParam);
|
---|
128 | }
|
---|
129 | else return window->DefMDIChildProcA(Msg, wParam, lParam);
|
---|
130 |
|
---|
131 | }
|
---|
132 | //******************************************************************************
|
---|
133 | //******************************************************************************
|
---|
134 | LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
135 | {
|
---|
136 | Win32MDIChildWindow *window;
|
---|
137 |
|
---|
138 | window = (Win32MDIChildWindow *)Win32BaseWindow::GetWindowFromHandle(hwnd);
|
---|
139 | if(!window) {
|
---|
140 | dprintf(("DefMDIProcW, window %x not found", hwnd));
|
---|
141 | return 0;
|
---|
142 | }
|
---|
143 | if(!window->isMDIChild()) {
|
---|
144 | dprintf(("App called DefMDIChildProcA for non-MDI window %x", hwnd));
|
---|
145 | return window->DefWindowProcW(Msg, wParam, lParam);
|
---|
146 | }
|
---|
147 | else return window->DefMDIChildProcW(Msg, wParam, lParam);
|
---|
148 | }
|
---|
149 | //******************************************************************************
|
---|
150 | //******************************************************************************
|
---|