source: trunk/src/user32/new/pmwindow.cpp@ 729

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

Window handle changes (now allocated in shared array) + postmessage changes + fixes

File size: 20.1 KB
Line 
1/* $Id: pmwindow.cpp,v 1.24 1999-08-28 19:32:46 sandervl Exp $ */
2/*
3 * Win32 Window Managment Code for OS/2
4 *
5 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
6 * Copyright 1999 Daniela Engert (dani@ngrt.de)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#define INCL_WIN
13#define INCL_GPI
14
15#include <os2.h> /* PM header file */
16#include <os2wrap.h>
17#include <stdlib.h>
18#include "win32type.h"
19#include <winconst.h>
20#include <wprocess.h>
21#include <misc.h>
22#include <win32wnd.h>
23#include <win32dlg.h>
24#include "pmwindow.h"
25#include "oslibwin.h"
26#include "oslibutil.h"
27#include "oslibgdi.h"
28#include "oslibmsg.h"
29
30HMQ hmq = 0; /* Message queue handle */
31HAB hab = 0;
32
33RECTL desktopRectl = {0};
34ULONG ScreenWidth = 0;
35ULONG ScreenHeight = 0;
36
37MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
38
39//******************************************************************************
40//Initialize PM; create hab, message queue and register special Win32 window classes
41//******************************************************************************
42BOOL InitPM()
43{
44 hab = WinInitialize(0);
45 dprintf(("Winitialize returned %x", hab));
46 hmq = WinCreateMsgQueue(hab, 0);
47
48 if(!hab || !hmq)
49 {
50 UINT error;
51 //CB: only fail on real error
52 error = WinGetLastError(hab) & 0xFFFF; //error code
53 if (!hab || error != PMERR_MSG_QUEUE_ALREADY_EXISTS)
54 {
55 dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq));
56 dprintf((" Error = %x",error));
57 return(FALSE);
58 }
59 else
60 {
61 if(!hab) {
62 hab = WinQueryAnchorBlock(HWND_DESKTOP);
63 dprintf(("WinQueryAnchorBlock returned %x", hab));
64 }
65 if(!hmq) {
66 hmq = HMQ_CURRENT;
67 }
68 }
69 }
70 SetThreadHAB(hab);
71 dprintf(("InitPM: hmq = %x", hmq));
72 SetThreadMessageQueue(hmq);
73
74 if(!WinRegisterClass( /* Register window class */
75 hab, /* Anchor block handle */
76 (PSZ)WIN32_STDCLASS, /* Window class name */
77 (PFNWP)Win32WindowProc, /* Address of window procedure */
78 CS_SIZEREDRAW | CS_HITTEST,
79 NROF_WIN32WNDBYTES)) {
80 dprintf(("WinRegisterClass Win32Window failed"));
81 return(FALSE);
82 }
83
84 WinQueryWindowRect(HWND_DESKTOP, &desktopRectl);
85 ScreenWidth = desktopRectl.xRight;
86 ScreenHeight = desktopRectl.yTop;
87
88 dprintf(("InitPM: Desktop (%d,%d)", ScreenWidth, ScreenHeight));
89 return OSLibInitMsgQueue();
90} /* End of main */
91//******************************************************************************
92//Win32 window message handler
93//******************************************************************************
94MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
95{
96 POSTMSG_PACKET *postmsg;
97 OSLIBPOINT point, ClientPoint;
98 Win32Window *win32wnd;
99 APIRET rc;
100
101 //Restore our FS selector
102 SetWin32TIB();
103
104 win32wnd = Win32Window::GetWindowFromOS2Handle(hwnd);
105
106 if(msg != WM_CREATE && win32wnd == NULL) {
107 dprintf(("Invalid win32wnd pointer for window %x!!", hwnd));
108 goto RunDefWndProc;
109 }
110 if(msg > WIN32APP_USERMSGBASE) {
111 //win32 app user message
112 dprintf(("PMWINDOW: Message %x (%x,%x) posted to window %x", (ULONG)msg-WIN32APP_USERMSGBASE, mp1, mp2, hwnd));
113 win32wnd->SendMessageA((ULONG)msg-WIN32APP_USERMSGBASE, (ULONG)mp1, (ULONG)mp2);
114 }
115 switch( msg )
116 {
117 //OS/2 msgs
118 case WM_CREATE:
119 //Processing is done in after WinCreateWindow returns
120 dprintf(("OS2: WM_CREATE %x", hwnd));
121 RestoreOS2TIB();
122 return (MRESULT)FALSE;
123
124 case WM_QUIT:
125 dprintf(("OS2: WM_QUIT %x", hwnd));
126 if(win32wnd->MsgQuit()) {
127 goto RunDefWndProc;
128 }
129 break;
130
131 case WM_CLOSE:
132 dprintf(("OS2: WM_CLOSE %x", hwnd));
133 if(win32wnd->MsgClose()) {
134 goto RunDefWndProc;
135 }
136 break;
137
138 case WM_DESTROY:
139 dprintf(("OS2: WM_DESTROY %x", hwnd));
140 if(win32wnd->MsgDestroy()) {
141 goto RunDefWndProc;
142 }
143 break;
144
145 case WM_ENABLE:
146 dprintf(("OS2: WM_ENABLE %x", hwnd));
147 if(win32wnd->MsgEnable((ULONG)mp1)) {
148 goto RunDefWndProc;
149 }
150 break;
151
152 case WM_SHOW:
153 dprintf(("OS2: WM_SHOW %x", hwnd));
154 if(win32wnd->MsgShow((ULONG)mp1)) {
155 goto RunDefWndProc;
156 }
157 break;
158
159 case WM_ADJUSTWINDOWPOS:
160 {
161 PSWP pswp = (PSWP)mp1;
162 SWP swpOld;
163 WINDOWPOS wp;
164 ULONG parentHeight = 0;
165 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE;
166
167 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
168
169 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
170
171 WinQueryWindowPos(hwnd, &swpOld);
172
173 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
174 if (win32wnd->isChild())
175 hParent = win32wnd->getParent()->getOS2WindowHandle();
176 else
177 hFrame = win32wnd->getOS2FrameWindowHandle();
178 }
179 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
180
181 wp.hwnd = win32wnd->getWindowHandle();
182 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
183 {
184 Win32Window *wndAfter = Win32Window::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
185 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
186 }
187 win32wnd->MsgPosChanging((LPARAM)&wp);
188 break;
189 }
190
191 case WM_WINDOWPOSCHANGED:
192 {
193 PSWP pswp = (PSWP)mp1;
194 PSWP pswpo = pswp + 1;
195 WINDOWPOS wp;
196 ULONG parentHeight = 0;
197 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE;
198 LONG yDelta = pswp->cy - pswpo->cy;
199 ULONG classStyle;
200
201 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
202
203 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
204
205 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
206 if (win32wnd->isChild())
207 hParent = win32wnd->getParent()->getOS2WindowHandle();
208 else
209 hFrame = win32wnd->getOS2FrameWindowHandle();
210 }
211 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswpo, hParent, hFrame);
212
213 win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy);
214 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy);
215
216 wp.hwnd = win32wnd->getWindowHandle();
217 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
218 {
219 Win32Window *wndAfter = Win32Window::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
220 wp.hwndInsertAfter = wndAfter->getWindowHandle();
221 }
222 classStyle = win32wnd->getClass()->getStyle();
223// if (yDelta != 0)
224 if ((yDelta != 0) && ((classStyle & CS_VREDRAW_W) ||
225 ((classStyle & CS_HREDRAW_W) && (pswp->cx != pswpo->cx))))
226 {
227 HENUM henum = WinBeginEnumWindows(pswp->hwnd);
228 SWP swp[10];
229 int i = 0;
230 HWND hwnd;
231
232 dprintf(("move children"));
233 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
234 {
235#if 0
236 /* Do not move MDI clients. MDI clients are a special case,
237 * even though they are bottom aligned they are always supposed
238 * to be the same size as their parent. This code is an
239 * optimization and will not work correctly if the this
240 * assumption is incorrect.
241 */
242 WinBase *pBase = (WinBase *)WinQueryDAXData( hwnd );
243 if ( pBase && pBase->typeOf() == mdiClient )
244 {
245 continue;
246 }
247#endif
248 // We don't know how many children we have so we'll move ten
249 // at a time. Not very nice, I know.
250 WinQueryWindowPos(hwnd, &(swp[i]));
251
252 // The SWP flags are all set but PM will ignore any
253 // superflous ones, so keep them as they contain useful
254 // minimise and maximise flags.
255 swp[i].y += yDelta;
256
257 if (i == 9)
258 {
259 WinSetMultWindowPos(GetThreadHAB(), swp, 10);
260 i = 0;
261 }
262 else
263 {
264 i++;
265 }
266 }
267
268 WinEndEnumWindows(henum);
269
270 // Any remaining windows?
271 if (i)
272 WinSetMultWindowPos(GetThreadHAB(), swp, i);
273 }
274 win32wnd->MsgPosChanged((LPARAM)&wp);
275
276 break;
277 }
278
279 case WM_ERASEBACKGROUND:
280 {
281 break;
282 }
283 case WM_SIZE:
284 {
285 break;
286 }
287
288 case WM_ACTIVATE:
289 {
290 HWND hwndActivate = (HWND)mp1;
291
292 dprintf(("OS2: WM_ACTIVATE %x", hwnd));
293 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
294 //another (non-win32) application's window
295 //set to NULL (allowed according to win32 SDK) to avoid problems
296 hwndActivate = NULL;
297 }
298 if(win32wnd->MsgActivate(1, hwndActivate)) {
299 goto RunDefWndProc;
300 }
301 break;
302 }
303 case WM_FOCUSCHANGE:
304 dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
305 goto RunDefWndProc;
306
307 case WM_SETFOCUS:
308 {
309 HWND hwndFocus = (HWND)mp1;
310
311 dprintf(("OS2: WM_SETFOCUS %x %d", hwnd, mp2));
312 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
313 //another (non-win32) application's window
314 //set to NULL (allowed according to win32 SDK) to avoid problems
315 hwndFocus = NULL;
316 }
317 if((ULONG)mp2 == TRUE) {
318 rc = win32wnd->MsgSetFocus(hwndFocus);
319 }
320 else rc = win32wnd->MsgKillFocus(hwndFocus);
321 if(rc) {
322 goto RunDefWndProc;
323 }
324 break;
325 }
326 //**************************************************************************
327 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen
328 //**************************************************************************
329 case WM_BUTTON1DOWN:
330 dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
331 point.x = (*(POINTS *)&mp1).x;
332 point.y = (*(POINTS *)&mp1).y;
333 ClientPoint.x = point.x;
334 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
335 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
336 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
337 goto RunDefWndProc;
338 }
339 break;
340
341 case WM_BUTTON1UP:
342 dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
343 point.x = (*(POINTS *)&mp1).x;
344 point.y = (*(POINTS *)&mp1).y;
345 ClientPoint.x = point.x;
346 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
347 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
348 if(win32wnd->MsgButton(BUTTON_LEFTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
349 goto RunDefWndProc;
350 }
351 break;
352 case WM_BUTTON1DBLCLK:
353 point.x = (*(POINTS *)&mp1).x;
354 point.y = (*(POINTS *)&mp1).y;
355 ClientPoint.x = point.x;
356 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
357 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
358 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
359 goto RunDefWndProc;
360 }
361 break;
362 case WM_BUTTON2DOWN:
363 point.x = (*(POINTS *)&mp1).x;
364 point.y = (*(POINTS *)&mp1).y;
365 ClientPoint.x = point.x;
366 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
367 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
368 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
369 goto RunDefWndProc;
370 }
371 break;
372 case WM_BUTTON2UP:
373 point.x = (*(POINTS *)&mp1).x;
374 point.y = (*(POINTS *)&mp1).y;
375 ClientPoint.x = point.x;
376 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
377 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
378 if(win32wnd->MsgButton(BUTTON_RIGHTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
379 goto RunDefWndProc;
380 }
381 break;
382 case WM_BUTTON2DBLCLK:
383 point.x = (*(POINTS *)&mp1).x;
384 point.y = (*(POINTS *)&mp1).y;
385 ClientPoint.x = point.x;
386 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
387 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
388 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
389 goto RunDefWndProc;
390 }
391 break;
392 case WM_BUTTON3DOWN:
393 point.x = (*(POINTS *)&mp1).x;
394 point.y = (*(POINTS *)&mp1).y;
395 ClientPoint.x = point.x;
396 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
397 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
398 if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
399 goto RunDefWndProc;
400 }
401 break;
402 case WM_BUTTON3UP:
403 point.x = (*(POINTS *)&mp1).x;
404 point.y = (*(POINTS *)&mp1).y;
405 ClientPoint.x = point.x;
406 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
407 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
408 if(win32wnd->MsgButton(BUTTON_MIDDLEUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
409 goto RunDefWndProc;
410 }
411 break;
412 case WM_BUTTON3DBLCLK:
413 point.x = (*(POINTS *)&mp1).x;
414 point.y = (*(POINTS *)&mp1).y;
415 ClientPoint.x = point.x;
416 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
417 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
418 if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
419 goto RunDefWndProc;
420 }
421 break;
422
423 case WM_BUTTON2MOTIONSTART:
424 case WM_BUTTON2MOTIONEND:
425 case WM_BUTTON2CLICK:
426 case WM_BUTTON1MOTIONSTART:
427 case WM_BUTTON1MOTIONEND:
428 case WM_BUTTON1CLICK:
429 case WM_BUTTON3MOTIONSTART:
430 case WM_BUTTON3MOTIONEND:
431 case WM_BUTTON3CLICK:
432 goto RunDefWndProc;
433
434 case WM_MOUSEMOVE:
435 {
436 ULONG keystate = 0;
437 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
438 keystate |= WMMOVE_LBUTTON;
439 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
440 keystate |= WMMOVE_MBUTTON;
441 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
442 keystate |= WMMOVE_RBUTTON;
443 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
444 keystate |= WMMOVE_SHIFT;
445 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
446 keystate |= WMMOVE_CTRL;
447
448 //OS/2 Window coordinates -> Win32 Window coordinates
449 //TODO: What do windows apps that handle this messages return?
450 if(!win32wnd->MsgMouseMove(keystate, SHORT1FROMMP(mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(mp1)))) {
451 goto RunDefWndProc;
452 }
453 break;
454 }
455
456 //**************************************************************************
457 //Slider messages
458 //**************************************************************************
459 case WM_VSCROLL:
460 case WM_HSCROLL:
461
462 case WM_CONTROL:
463
464 case WM_COMMAND:
465 if(SHORT1FROMMP(mp2) == CMDSRC_MENU) {
466 win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0);
467 }
468 if(SHORT1FROMMP(mp2) == CMDSRC_ACCELERATOR) {
469 win32wnd->MsgCommand(CMD_ACCELERATOR, SHORT1FROMMP(mp1), 0);
470 }
471 //todo controls + accelerators
472 break;
473
474 case WM_SYSCOMMAND:
475 {
476 ULONG x = 0, y = 0;
477 ULONG win32sc;
478
479 if(SHORT2FROMMP(mp2) == TRUE) {//syscommand caused by mouse action
480 POINTL pointl;
481 WinQueryPointerPos(HWND_DESKTOP, &pointl);
482 x = pointl.x;
483 y = ScreenHeight - y;
484 }
485 switch(SHORT1FROMMP(mp1)) {
486 case SC_MOVE:
487 win32sc = WIN32SC_MOVE;
488 break;
489 case SC_CLOSE:
490 win32sc = WIN32SC_CLOSE;
491 break;
492 case SC_MAXIMIZE:
493 win32sc = WIN32SC_MAXIMIZE;
494 break;
495 case SC_MINIMIZE:
496 win32sc = WIN32SC_MINIMIZE;
497 break;
498 case SC_NEXTFRAME:
499 case SC_NEXTWINDOW:
500 win32sc = WIN32SC_NEXTWINDOW;
501 break;
502 case SC_RESTORE:
503 win32sc = WIN32SC_RESTORE;
504 break;
505 case SC_TASKMANAGER:
506 win32sc = WIN32SC_TASKLIST;
507 break;
508 default:
509 goto RunDefWndProc;
510 }
511 dprintf(("WM_SYSCOMMAND %x %x (%d,%d)", hwnd, win32sc, x, y));
512 if(win32wnd->MsgSysCommand(win32sc, x, y)) {
513 goto RunDefWndProc;
514 }
515 break;
516 }
517 case WM_CHAR:
518 {
519 ULONG keyflags = 0, vkey = 0;
520 ULONG fl = SHORT1FROMMP(mp1);
521
522 if(!(fl & KC_CHAR)) {
523 dprintf(("WM_CHAR: no valid character code"));
524 goto RunDefWndProc;
525 }
526 if(fl & KC_VIRTUALKEY) {
527 vkey = SHORT2FROMMP(mp2);
528 }
529 if(fl & KC_KEYUP) {
530 keyflags |= KEY_UP;
531 }
532 if(fl & KC_ALT) {
533 keyflags |= KEY_ALTDOWN;
534 }
535 if(fl & KC_PREVDOWN) {
536 keyflags |= KEY_PREVDOWN;
537 }
538 if(fl & KC_DEADKEY) {
539 keyflags |= KEY_DEADKEY;
540 }
541 if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
542 goto RunDefWndProc;
543 }
544 break;
545 }
546 case WM_INITMENU:
547 case WM_MENUSELECT:
548 case WM_MENUEND:
549 case WM_NEXTMENU:
550
551 case WM_TIMER:
552 goto RunDefWndProc;
553
554 case WM_SETWINDOWPARAMS:
555 {
556 WNDPARAMS *wndParams = (WNDPARAMS *)mp1;
557
558 dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
559 if(wndParams->fsStatus & WPM_TEXT) {
560 if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
561 goto RunDefWndProc;
562 }
563 }
564 goto RunDefWndProc;
565 }
566
567 case WM_QUERYWINDOWPARAMS:
568 {
569 PWNDPARAMS wndpars = (PWNDPARAMS)mp1;
570 ULONG textlen;
571 PSZ wintext;
572
573 if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) {
574 if(wndpars->fsStatus & WPM_CCHTEXT)
575 wndpars->cchText = win32wnd->MsgGetTextLength();
576 if(wndpars->fsStatus & WPM_TEXT)
577 wndpars->pszText = win32wnd->MsgGetText();
578 return (MRESULT)TRUE;
579 }
580 goto RunDefWndProc;
581 }
582
583 case WM_PAINT:
584 dprintf(("OS2: WM_PAINT %x", hwnd));
585 if(win32wnd->MsgPaint(0, 0)) {
586 goto RunDefWndProc;
587 }
588 break;
589
590 case WM_HITTEST:
591 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) {
592 goto RunDefWndProc;
593 }
594 break;
595
596 case WM_SYSCOLORCHANGE:
597 case WM_SYSVALUECHANGED:
598 case WM_CALCVALIDRECTS:
599 case WM_SETSELECTION:
600 case WM_PPAINT:
601 case WM_PSETFOCUS:
602 case WM_PSYSCOLORCHANGE:
603 case WM_PSIZE:
604 case WM_PACTIVATE:
605 case WM_PCONTROL:
606 case WM_HELP:
607 case WM_APPTERMINATENOTIFY:
608 case WM_PRESPARAMCHANGED:
609 case WM_DRAWITEM:
610 case WM_MEASUREITEM:
611 case WM_CONTROLPOINTER:
612 case WM_QUERYDLGCODE:
613 case WM_SUBSTITUTESTRING:
614 case WM_MATCHMNEMONIC:
615 case WM_SAVEAPPLICATION:
616 case WM_SEMANTICEVENT:
617 default:
618// dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
619 RestoreOS2TIB();
620 return WinDefWindowProc( hwnd, msg, mp1, mp2 );
621 }
622 RestoreOS2TIB();
623 return (MRESULT)FALSE;
624
625RunDefWndProc:
626// dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
627 RestoreOS2TIB();
628 return WinDefWindowProc( hwnd, msg, mp1, mp2 );
629} /* End of Win32WindowProc */
630//******************************************************************************
631//******************************************************************************
Note: See TracBrowser for help on using the repository browser.