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