source: trunk/src/user32/new/defwndproc.cpp@ 392

Last change on this file since 392 was 392, checked in by sandervl, 26 years ago

Lots of changes; Solitaire now starts

File size: 10.3 KB
Line 
1/* $Id: defwndproc.cpp,v 1.4 1999-07-25 15:51:55 sandervl Exp $ */
2
3/*
4 * Win32 default window API functions for OS/2
5 *
6 * Copyright 1998 Sander van Leeuwen
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#include "user32.h"
13#include "syscolor.h"
14#include "win32wnd.h"
15
16#ifdef DEBUG
17char *GetMsgText(int Msg);
18#endif
19
20//******************************************************************************
21//******************************************************************************
22LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
23{
24 Win32Window *window;
25
26 window = Win32Window::GetWindowFromHandle(hwnd);
27 if(!window) {
28 dprintf(("DefWindowProcA, window %x not found", hwnd));
29 return 0;
30 }
31 return window->DefWindowProcA(Msg, wParam, lParam);
32}
33//******************************************************************************
34//******************************************************************************
35LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
36{
37 Win32Window *window;
38
39 window = Win32Window::GetWindowFromHandle(hwnd);
40 if(!window) {
41 dprintf(("DefWindowProcW, window %x not found", hwnd));
42 return 0;
43 }
44 return window->DefWindowProcW(Msg, wParam, lParam);
45}
46//******************************************************************************
47//******************************************************************************
48LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
49{
50#ifdef DEBUG
51//// WriteLog("*DDP*");
52#endif
53 switch(Msg) {
54 case WM_SETREDRAW: //Open32 does not set the visible flag
55 if(wParam)
56 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
57 else
58 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
59 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
60 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
61 return(TRUE);
62 case WM_CTLCOLORMSGBOX:
63 case WM_CTLCOLOREDIT:
64 case WM_CTLCOLORLISTBOX:
65 case WM_CTLCOLORBTN:
66 case WM_CTLCOLORDLG:
67 case WM_CTLCOLORSTATIC:
68 case WM_CTLCOLORSCROLLBAR:
69 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
70 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
71 return GetSysColorBrush(COLOR_BTNFACE);
72
73 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
74 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
75 return 0;
76
77 default:
78 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
79 }
80}
81//******************************************************************************
82//NOTE: Unicode msg translation!
83//******************************************************************************
84LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
85{
86#ifdef DEBUG
87//// WriteLog("*DDPW*");
88#endif
89 switch(Msg) {
90 case WM_SETREDRAW: //Open32 does not set the visible flag
91 if(wParam)
92 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
93 else
94 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
95 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
96 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
97 return(TRUE);
98 case WM_CTLCOLORMSGBOX:
99 case WM_CTLCOLOREDIT:
100 case WM_CTLCOLORLISTBOX:
101 case WM_CTLCOLORBTN:
102 case WM_CTLCOLORDLG:
103 case WM_CTLCOLORSTATIC:
104 case WM_CTLCOLORSCROLLBAR:
105 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
106 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
107 return GetSysColorBrush(COLOR_BTNFACE);
108
109 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
110 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
111 return 0;
112
113 default:
114 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
115 }
116}
117//******************************************************************************
118//******************************************************************************
119LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
120{
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);
150 }
151}
152//******************************************************************************
153//NOTE: Unicode msg translation!
154//******************************************************************************
155LRESULT 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//******************************************************************************
190LRESULT 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//******************************************************************************
226LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
227{
228#ifdef DEBUG
229//// WriteLog("*DMPW*");
230#endif
231 switch(Msg) {
232 case WM_SETREDRAW: //Open32 does not set the visible flag
233 if(wParam)
234 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
235 else
236 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
237 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
238 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
239 return(TRUE);
240 case WM_CTLCOLORMSGBOX:
241 case WM_CTLCOLOREDIT:
242 case WM_CTLCOLORLISTBOX:
243 case WM_CTLCOLORBTN:
244 case WM_CTLCOLORDLG:
245 case WM_CTLCOLORSTATIC:
246 case WM_CTLCOLORSCROLLBAR:
247 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
248 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
249 return GetSysColorBrush(COLOR_BTNFACE);
250
251 case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
252 dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
253 return 0;
254
255 default:
256 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
257 }
258}
259//******************************************************************************
260//******************************************************************************
Note: See TracBrowser for help on using the repository browser.