1 | /* $Id: defwndproc.cpp,v 1.4 1999-06-21 00:48:57 buerkle 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 |
|
---|
15 | //******************************************************************************
|
---|
16 | //******************************************************************************
|
---|
17 | LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
18 | {
|
---|
19 | #ifdef DEBUG
|
---|
20 | //// WriteLog("DEFWNDPROC ");
|
---|
21 | //// WriteLog("*DWP*");
|
---|
22 | #endif
|
---|
23 | switch(Msg) {
|
---|
24 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
25 | if(wParam)
|
---|
26 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
|
---|
27 | else
|
---|
28 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
---|
29 | return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
|
---|
30 | case WM_NCCREATE://SvL: YAFMO (yet another feature missing in Open32)
|
---|
31 | return(TRUE);
|
---|
32 | case WM_CTLCOLORMSGBOX:
|
---|
33 | case WM_CTLCOLOREDIT:
|
---|
34 | case WM_CTLCOLORLISTBOX:
|
---|
35 | case WM_CTLCOLORBTN:
|
---|
36 | case WM_CTLCOLORDLG:
|
---|
37 | case WM_CTLCOLORSTATIC:
|
---|
38 | case WM_CTLCOLORSCROLLBAR:
|
---|
39 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
40 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
41 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
42 |
|
---|
43 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
44 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
45 | return 0;
|
---|
46 | default:
|
---|
47 | return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
|
---|
48 | }
|
---|
49 | }
|
---|
50 | //******************************************************************************
|
---|
51 | //NOTE: Unicode msg translation!
|
---|
52 | //******************************************************************************
|
---|
53 | LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
54 | {
|
---|
55 | #ifdef DEBUG
|
---|
56 | //// WriteLog("*DWPW*");
|
---|
57 | #endif
|
---|
58 | switch(Msg) {
|
---|
59 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
60 | if(wParam)
|
---|
61 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
|
---|
62 | else
|
---|
63 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
---|
64 | return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
|
---|
65 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
66 | return(TRUE);
|
---|
67 | case WM_CTLCOLORMSGBOX:
|
---|
68 | case WM_CTLCOLOREDIT:
|
---|
69 | case WM_CTLCOLORLISTBOX:
|
---|
70 | case WM_CTLCOLORBTN:
|
---|
71 | case WM_CTLCOLORDLG:
|
---|
72 | case WM_CTLCOLORSTATIC:
|
---|
73 | case WM_CTLCOLORSCROLLBAR:
|
---|
74 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
75 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
76 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
77 |
|
---|
78 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
79 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
80 | return 0;
|
---|
81 |
|
---|
82 | default:
|
---|
83 | return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
|
---|
84 | }
|
---|
85 | }
|
---|
86 | //******************************************************************************
|
---|
87 | //******************************************************************************
|
---|
88 | LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
89 | {
|
---|
90 | #ifdef DEBUG
|
---|
91 | //// WriteLog("*DDP*");
|
---|
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);
|
---|
112 |
|
---|
113 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
114 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
115 | return 0;
|
---|
116 |
|
---|
117 | default:
|
---|
118 | return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
|
---|
119 | }
|
---|
120 | }
|
---|
121 | //******************************************************************************
|
---|
122 | //NOTE: Unicode msg translation!
|
---|
123 | //******************************************************************************
|
---|
124 | LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
125 | {
|
---|
126 | #ifdef DEBUG
|
---|
127 | //// WriteLog("*DDPW*");
|
---|
128 | #endif
|
---|
129 | switch(Msg) {
|
---|
130 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
131 | if(wParam)
|
---|
132 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
|
---|
133 | else
|
---|
134 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
---|
135 | return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
|
---|
136 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
137 | return(TRUE);
|
---|
138 | case WM_CTLCOLORMSGBOX:
|
---|
139 | case WM_CTLCOLOREDIT:
|
---|
140 | case WM_CTLCOLORLISTBOX:
|
---|
141 | case WM_CTLCOLORBTN:
|
---|
142 | case WM_CTLCOLORDLG:
|
---|
143 | case WM_CTLCOLORSTATIC:
|
---|
144 | case WM_CTLCOLORSCROLLBAR:
|
---|
145 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
146 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
147 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
148 |
|
---|
149 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
150 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
151 | return 0;
|
---|
152 |
|
---|
153 | default:
|
---|
154 | return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
|
---|
155 | }
|
---|
156 | }
|
---|
157 | //******************************************************************************
|
---|
158 | //******************************************************************************
|
---|
159 | LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
160 | {
|
---|
161 | #ifdef DEBUG
|
---|
162 | //// WriteLog("*DFP*");
|
---|
163 | #endif
|
---|
164 | switch(Msg) {
|
---|
165 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
166 | if(wParam)
|
---|
167 | SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
|
---|
168 | else
|
---|
169 | SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
|
---|
170 | return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
|
---|
171 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
172 | return(TRUE);
|
---|
173 | case WM_CTLCOLORMSGBOX:
|
---|
174 | case WM_CTLCOLOREDIT:
|
---|
175 | case WM_CTLCOLORLISTBOX:
|
---|
176 | case WM_CTLCOLORBTN:
|
---|
177 | case WM_CTLCOLORDLG:
|
---|
178 | case WM_CTLCOLORSTATIC:
|
---|
179 | case WM_CTLCOLORSCROLLBAR:
|
---|
180 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
181 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
182 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
183 |
|
---|
184 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
185 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
|
---|
186 | return 0;
|
---|
187 |
|
---|
188 | default:
|
---|
189 | return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
|
---|
190 | }
|
---|
191 | }
|
---|
192 | //******************************************************************************
|
---|
193 | //NOTE: Unicode msg translation!
|
---|
194 | //******************************************************************************
|
---|
195 | LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
196 | {
|
---|
197 | #ifdef DEBUG
|
---|
198 | //// WriteLog("*DFPW*");
|
---|
199 | #endif
|
---|
200 | switch(Msg) {
|
---|
201 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
202 | if(wParam)
|
---|
203 | SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
|
---|
204 | else
|
---|
205 | SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
|
---|
206 | return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
|
---|
207 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
208 | return(TRUE);
|
---|
209 | case WM_CTLCOLORMSGBOX:
|
---|
210 | case WM_CTLCOLOREDIT:
|
---|
211 | case WM_CTLCOLORLISTBOX:
|
---|
212 | case WM_CTLCOLORBTN:
|
---|
213 | case WM_CTLCOLORDLG:
|
---|
214 | case WM_CTLCOLORSTATIC:
|
---|
215 | case WM_CTLCOLORSCROLLBAR:
|
---|
216 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
217 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
218 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
219 |
|
---|
220 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
221 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
|
---|
222 | return 0;
|
---|
223 |
|
---|
224 | default:
|
---|
225 | return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
|
---|
226 | }
|
---|
227 | }
|
---|
228 | //******************************************************************************
|
---|
229 | //******************************************************************************
|
---|
230 | LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
231 | {
|
---|
232 | #ifdef DEBUG
|
---|
233 | //// WriteLog("*DMP*");
|
---|
234 | #endif
|
---|
235 | switch(Msg) {
|
---|
236 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
237 | if(wParam)
|
---|
238 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
|
---|
239 | else
|
---|
240 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
---|
241 | return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
|
---|
242 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
243 | return(TRUE);
|
---|
244 | case WM_CTLCOLORMSGBOX:
|
---|
245 | case WM_CTLCOLOREDIT:
|
---|
246 | case WM_CTLCOLORLISTBOX:
|
---|
247 | case WM_CTLCOLORBTN:
|
---|
248 | case WM_CTLCOLORDLG:
|
---|
249 | case WM_CTLCOLORSTATIC:
|
---|
250 | case WM_CTLCOLORSCROLLBAR:
|
---|
251 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
252 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
253 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
254 |
|
---|
255 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
256 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
257 | return 0;
|
---|
258 |
|
---|
259 | default:
|
---|
260 | return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
|
---|
261 | }
|
---|
262 | }
|
---|
263 | //******************************************************************************
|
---|
264 | //NOTE: Unicode msg translation!
|
---|
265 | //******************************************************************************
|
---|
266 | LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
267 | {
|
---|
268 | #ifdef DEBUG
|
---|
269 | //// WriteLog("*DMPW*");
|
---|
270 | #endif
|
---|
271 | switch(Msg) {
|
---|
272 | case WM_SETREDRAW: //Open32 does not set the visible flag
|
---|
273 | if(wParam)
|
---|
274 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
|
---|
275 | else
|
---|
276 | SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
|
---|
277 | return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
|
---|
278 | case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
|
---|
279 | return(TRUE);
|
---|
280 | case WM_CTLCOLORMSGBOX:
|
---|
281 | case WM_CTLCOLOREDIT:
|
---|
282 | case WM_CTLCOLORLISTBOX:
|
---|
283 | case WM_CTLCOLORBTN:
|
---|
284 | case WM_CTLCOLORDLG:
|
---|
285 | case WM_CTLCOLORSTATIC:
|
---|
286 | case WM_CTLCOLORSCROLLBAR:
|
---|
287 | SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
|
---|
288 | SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
---|
289 | return GetSysColorBrush(COLOR_BTNFACE);
|
---|
290 |
|
---|
291 | case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
|
---|
292 | dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
|
---|
293 | return 0;
|
---|
294 |
|
---|
295 | default:
|
---|
296 | return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
|
---|
297 | }
|
---|
298 | }
|
---|
299 | //******************************************************************************
|
---|
300 | //******************************************************************************
|
---|