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

Last change on this file since 728 was 728, checked in by dengert, 26 years ago

reposition child windows when parent height is changed

File size: 20.4 KB
Line 
1/* $Id: pmwindow.cpp,v 1.23 1999-08-28 17:24:45 dengert 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 8)) {
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 switch( msg )
111 {
112 //internal messages
113 case WM_WIN32_POSTMESSAGEA:
114 postmsg = (POSTMSG_PACKET *)mp1;
115 if(postmsg == NULL) {
116 dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!"));
117 break;
118 }
119 win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam);
120 free(postmsg);
121 break;
122
123 case WM_WIN32_POSTMESSAGEW:
124 postmsg = (POSTMSG_PACKET *)mp1;
125 if(postmsg == NULL) {
126 dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!"));
127 break;
128 }
129 win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam);
130 free(postmsg);
131 break;
132
133 //OS/2 msgs
134 case WM_CREATE:
135 //Processing is done in after WinCreateWindow returns
136 dprintf(("OS2: WM_CREATE %x", hwnd));
137 RestoreOS2TIB();
138 return (MRESULT)FALSE;
139
140 case WM_QUIT:
141 dprintf(("OS2: WM_QUIT %x", hwnd));
142 if(win32wnd->MsgQuit()) {
143 goto RunDefWndProc;
144 }
145 break;
146
147 case WM_CLOSE:
148 dprintf(("OS2: WM_CLOSE %x", hwnd));
149 if(win32wnd->MsgClose()) {
150 goto RunDefWndProc;
151 }
152 break;
153
154 case WM_DESTROY:
155 dprintf(("OS2: WM_DESTROY %x", hwnd));
156 if(win32wnd->MsgDestroy()) {
157 goto RunDefWndProc;
158 }
159 break;
160
161 case WM_ENABLE:
162 dprintf(("OS2: WM_ENABLE %x", hwnd));
163 if(win32wnd->MsgEnable((ULONG)mp1)) {
164 goto RunDefWndProc;
165 }
166 break;
167
168 case WM_SHOW:
169 dprintf(("OS2: WM_SHOW %x", hwnd));
170 if(win32wnd->MsgShow((ULONG)mp1)) {
171 goto RunDefWndProc;
172 }
173 break;
174
175 case WM_ADJUSTWINDOWPOS:
176 {
177 PSWP pswp = (PSWP)mp1;
178 SWP swpOld;
179 WINDOWPOS wp;
180 ULONG parentHeight = 0;
181 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE;
182
183 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
184
185 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
186
187 WinQueryWindowPos(hwnd, &swpOld);
188
189 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
190 if (win32wnd->isChild())
191 hParent = win32wnd->getParent()->getOS2WindowHandle();
192 else
193 hFrame = win32wnd->getOS2FrameWindowHandle();
194 }
195 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
196
197 wp.hwnd = win32wnd->getWindowHandle();
198 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
199 {
200 Win32Window *wndAfter = Win32Window::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
201 wp.hwndInsertAfter = wndAfter->getWindowHandle();
202 }
203 win32wnd->MsgPosChanging((LPARAM)&wp);
204 break;
205 }
206
207 case WM_WINDOWPOSCHANGED:
208 {
209 PSWP pswp = (PSWP)mp1;
210 PSWP pswpo = pswp + 1;
211 WINDOWPOS wp;
212 ULONG parentHeight = 0;
213 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE;
214 LONG yDelta = pswp->cy - pswpo->cy;
215 ULONG classStyle;
216
217 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
218
219 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
220
221 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
222 if (win32wnd->isChild())
223 hParent = win32wnd->getParent()->getOS2WindowHandle();
224 else
225 hFrame = win32wnd->getOS2FrameWindowHandle();
226 }
227 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswpo, hParent, hFrame);
228
229 win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy);
230 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy);
231
232 wp.hwnd = win32wnd->getWindowHandle();
233 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
234 {
235 Win32Window *wndAfter = Win32Window::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
236 wp.hwndInsertAfter = wndAfter->getWindowHandle();
237 }
238 classStyle = win32wnd->getClass()->getStyle();
239// if (yDelta != 0)
240 if ((yDelta != 0) && ((classStyle & CS_VREDRAW_W) ||
241 ((classStyle & CS_HREDRAW_W) && (pswp->cx != pswpo->cx))))
242 {
243 HENUM henum = WinBeginEnumWindows(pswp->hwnd);
244 SWP swp[10];
245 int i = 0;
246 HWND hwnd;
247
248 dprintf(("move children"));
249 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
250 {
251#if 0
252 /* Do not move MDI clients. MDI clients are a special case,
253 * even though they are bottom aligned they are always supposed
254 * to be the same size as their parent. This code is an
255 * optimization and will not work correctly if the this
256 * assumption is incorrect.
257 */
258 WinBase *pBase = (WinBase *)WinQueryDAXData( hwnd );
259 if ( pBase && pBase->typeOf() == mdiClient )
260 {
261 continue;
262 }
263#endif
264 // We don't know how many children we have so we'll move ten
265 // at a time. Not very nice, I know.
266 WinQueryWindowPos(hwnd, &(swp[i]));
267
268 // The SWP flags are all set but PM will ignore any
269 // superflous ones, so keep them as they contain useful
270 // minimise and maximise flags.
271 swp[i].y += yDelta;
272
273 if (i == 9)
274 {
275 WinSetMultWindowPos(GetThreadHAB(), swp, 10);
276 i = 0;
277 }
278 else
279 {
280 i++;
281 }
282 }
283
284 WinEndEnumWindows(henum);
285
286 // Any remaining windows?
287 if (i)
288 WinSetMultWindowPos(GetThreadHAB(), swp, i);
289 }
290 win32wnd->MsgPosChanged((LPARAM)&wp);
291
292 break;
293 }
294
295 case WM_ERASEBACKGROUND:
296 {
297 break;
298 }
299 case WM_SIZE:
300 {
301 break;
302 }
303
304 case WM_ACTIVATE:
305 {
306 HWND hwndActivate = (HWND)mp1;
307
308 dprintf(("OS2: WM_ACTIVATE %x", hwnd));
309 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
310 //another (non-win32) application's window
311 //set to NULL (allowed according to win32 SDK) to avoid problems
312 hwndActivate = NULL;
313 }
314 if(win32wnd->MsgActivate(1, hwndActivate)) {
315 goto RunDefWndProc;
316 }
317 break;
318 }
319 case WM_FOCUSCHANGE:
320 dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));
321 goto RunDefWndProc;
322
323 case WM_SETFOCUS:
324 {
325 HWND hwndFocus = (HWND)mp1;
326
327 dprintf(("OS2: WM_SETFOCUS %x %d", hwnd, mp2));
328 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
329 //another (non-win32) application's window
330 //set to NULL (allowed according to win32 SDK) to avoid problems
331 hwndFocus = NULL;
332 }
333 if((ULONG)mp2 == TRUE) {
334 rc = win32wnd->MsgSetFocus(hwndFocus);
335 }
336 else rc = win32wnd->MsgKillFocus(hwndFocus);
337 if(rc) {
338 goto RunDefWndProc;
339 }
340 break;
341 }
342 //**************************************************************************
343 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen
344 //**************************************************************************
345 case WM_BUTTON1DOWN:
346 dprintf(("OS2: WM_BUTTON1DOWN %x", hwnd));
347 point.x = (*(POINTS *)&mp1).x;
348 point.y = (*(POINTS *)&mp1).y;
349 ClientPoint.x = point.x;
350 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
351 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
352 if(win32wnd->MsgButton(BUTTON_LEFTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
353 goto RunDefWndProc;
354 }
355 break;
356
357 case WM_BUTTON1UP:
358 dprintf(("OS2: WM_BUTTON1UP %x", hwnd));
359 point.x = (*(POINTS *)&mp1).x;
360 point.y = (*(POINTS *)&mp1).y;
361 ClientPoint.x = point.x;
362 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
363 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
364 if(win32wnd->MsgButton(BUTTON_LEFTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
365 goto RunDefWndProc;
366 }
367 break;
368 case WM_BUTTON1DBLCLK:
369 point.x = (*(POINTS *)&mp1).x;
370 point.y = (*(POINTS *)&mp1).y;
371 ClientPoint.x = point.x;
372 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
373 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
374 if(win32wnd->MsgButton(BUTTON_LEFTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
375 goto RunDefWndProc;
376 }
377 break;
378 case WM_BUTTON2DOWN:
379 point.x = (*(POINTS *)&mp1).x;
380 point.y = (*(POINTS *)&mp1).y;
381 ClientPoint.x = point.x;
382 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
383 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
384 if(win32wnd->MsgButton(BUTTON_RIGHTDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
385 goto RunDefWndProc;
386 }
387 break;
388 case WM_BUTTON2UP:
389 point.x = (*(POINTS *)&mp1).x;
390 point.y = (*(POINTS *)&mp1).y;
391 ClientPoint.x = point.x;
392 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
393 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
394 if(win32wnd->MsgButton(BUTTON_RIGHTUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
395 goto RunDefWndProc;
396 }
397 break;
398 case WM_BUTTON2DBLCLK:
399 point.x = (*(POINTS *)&mp1).x;
400 point.y = (*(POINTS *)&mp1).y;
401 ClientPoint.x = point.x;
402 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
403 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
404 if(win32wnd->MsgButton(BUTTON_RIGHTDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
405 goto RunDefWndProc;
406 }
407 break;
408 case WM_BUTTON3DOWN:
409 point.x = (*(POINTS *)&mp1).x;
410 point.y = (*(POINTS *)&mp1).y;
411 ClientPoint.x = point.x;
412 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
413 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
414 if(win32wnd->MsgButton(BUTTON_MIDDLEDOWN, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
415 goto RunDefWndProc;
416 }
417 break;
418 case WM_BUTTON3UP:
419 point.x = (*(POINTS *)&mp1).x;
420 point.y = (*(POINTS *)&mp1).y;
421 ClientPoint.x = point.x;
422 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
423 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
424 if(win32wnd->MsgButton(BUTTON_MIDDLEUP, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
425 goto RunDefWndProc;
426 }
427 break;
428 case WM_BUTTON3DBLCLK:
429 point.x = (*(POINTS *)&mp1).x;
430 point.y = (*(POINTS *)&mp1).y;
431 ClientPoint.x = point.x;
432 ClientPoint.y = MapOS2ToWin32Y(hwnd, 1, point.y);
433 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP, hwnd, &point);
434 if(win32wnd->MsgButton(BUTTON_MIDDLEDBLCLICK, point.x, point.y, ClientPoint.x, ClientPoint.y)) {
435 goto RunDefWndProc;
436 }
437 break;
438
439 case WM_BUTTON2MOTIONSTART:
440 case WM_BUTTON2MOTIONEND:
441 case WM_BUTTON2CLICK:
442 case WM_BUTTON1MOTIONSTART:
443 case WM_BUTTON1MOTIONEND:
444 case WM_BUTTON1CLICK:
445 case WM_BUTTON3MOTIONSTART:
446 case WM_BUTTON3MOTIONEND:
447 case WM_BUTTON3CLICK:
448 goto RunDefWndProc;
449
450 case WM_MOUSEMOVE:
451 {
452 ULONG keystate = 0;
453 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1))
454 keystate |= WMMOVE_LBUTTON;
455 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2))
456 keystate |= WMMOVE_MBUTTON;
457 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3))
458 keystate |= WMMOVE_RBUTTON;
459 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT))
460 keystate |= WMMOVE_SHIFT;
461 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL))
462 keystate |= WMMOVE_CTRL;
463
464 //OS/2 Window coordinates -> Win32 Window coordinates
465 //TODO: What do windows apps that handle this messages return?
466 if(!win32wnd->MsgMouseMove(keystate, SHORT1FROMMP(mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(mp1)))) {
467 goto RunDefWndProc;
468 }
469 break;
470 }
471
472 //**************************************************************************
473 //Slider messages
474 //**************************************************************************
475 case WM_VSCROLL:
476 case WM_HSCROLL:
477
478 case WM_CONTROL:
479
480 case WM_COMMAND:
481 if(SHORT1FROMMP(mp2) == CMDSRC_MENU) {
482 win32wnd->MsgCommand(CMD_MENU, SHORT1FROMMP(mp1), 0);
483 }
484 if(SHORT1FROMMP(mp2) == CMDSRC_ACCELERATOR) {
485 win32wnd->MsgCommand(CMD_ACCELERATOR, SHORT1FROMMP(mp1), 0);
486 }
487 //todo controls + accelerators
488 break;
489
490 case WM_SYSCOMMAND:
491 {
492 ULONG x = 0, y = 0;
493 ULONG win32sc;
494
495 if(SHORT2FROMMP(mp2) == TRUE) {//syscommand caused by mouse action
496 POINTL pointl;
497 WinQueryPointerPos(HWND_DESKTOP, &pointl);
498 x = pointl.x;
499 y = ScreenHeight - y;
500 }
501 switch(SHORT1FROMMP(mp1)) {
502 case SC_MOVE:
503 win32sc = WIN32SC_MOVE;
504 break;
505 case SC_CLOSE:
506 win32sc = WIN32SC_CLOSE;
507 break;
508 case SC_MAXIMIZE:
509 win32sc = WIN32SC_MAXIMIZE;
510 break;
511 case SC_MINIMIZE:
512 win32sc = WIN32SC_MINIMIZE;
513 break;
514 case SC_NEXTFRAME:
515 case SC_NEXTWINDOW:
516 win32sc = WIN32SC_NEXTWINDOW;
517 break;
518 case SC_RESTORE:
519 win32sc = WIN32SC_RESTORE;
520 break;
521 case SC_TASKMANAGER:
522 win32sc = WIN32SC_TASKLIST;
523 break;
524 default:
525 goto RunDefWndProc;
526 }
527 dprintf(("WM_SYSCOMMAND %x %x (%d,%d)", hwnd, win32sc, x, y));
528 if(win32wnd->MsgSysCommand(win32sc, x, y)) {
529 goto RunDefWndProc;
530 }
531 break;
532 }
533 case WM_CHAR:
534 {
535 ULONG keyflags = 0, vkey = 0;
536 ULONG fl = SHORT1FROMMP(mp1);
537
538 if(!(fl & KC_CHAR)) {
539 dprintf(("WM_CHAR: no valid character code"));
540 goto RunDefWndProc;
541 }
542 if(fl & KC_VIRTUALKEY) {
543 vkey = SHORT2FROMMP(mp2);
544 }
545 if(fl & KC_KEYUP) {
546 keyflags |= KEY_UP;
547 }
548 if(fl & KC_ALT) {
549 keyflags |= KEY_ALTDOWN;
550 }
551 if(fl & KC_PREVDOWN) {
552 keyflags |= KEY_PREVDOWN;
553 }
554 if(fl & KC_DEADKEY) {
555 keyflags |= KEY_DEADKEY;
556 }
557 if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
558 goto RunDefWndProc;
559 }
560 break;
561 }
562 case WM_INITMENU:
563 case WM_MENUSELECT:
564 case WM_MENUEND:
565 case WM_NEXTMENU:
566
567 case WM_TIMER:
568 goto RunDefWndProc;
569
570 case WM_SETWINDOWPARAMS:
571 {
572 WNDPARAMS *wndParams = (WNDPARAMS *)mp1;
573
574 dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
575 if(wndParams->fsStatus & WPM_TEXT) {
576 if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
577 goto RunDefWndProc;
578 }
579 }
580 goto RunDefWndProc;
581 }
582
583 case WM_QUERYWINDOWPARAMS:
584 {
585 PWNDPARAMS wndpars = (PWNDPARAMS)mp1;
586 ULONG textlen;
587 PSZ wintext;
588
589 if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) {
590 if(wndpars->fsStatus & WPM_CCHTEXT)
591 wndpars->cchText = win32wnd->MsgGetTextLength();
592 if(wndpars->fsStatus & WPM_TEXT)
593 wndpars->pszText = win32wnd->MsgGetText();
594 return (MRESULT)TRUE;
595 }
596 goto RunDefWndProc;
597 }
598
599 case WM_PAINT:
600 dprintf(("OS2: WM_PAINT %x", hwnd));
601 if(win32wnd->MsgPaint(0, 0)) {
602 goto RunDefWndProc;
603 }
604 break;
605
606 case WM_HITTEST:
607 if(win32wnd->MsgHitTest((*(POINTS *)&mp1).x, MapOS2ToWin32Y(OSLIB_HWND_DESKTOP, hwnd, (*(POINTS *)&mp1).y))) {
608 goto RunDefWndProc;
609 }
610 break;
611
612 case WM_SYSCOLORCHANGE:
613 case WM_SYSVALUECHANGED:
614 case WM_CALCVALIDRECTS:
615 case WM_SETSELECTION:
616 case WM_PPAINT:
617 case WM_PSETFOCUS:
618 case WM_PSYSCOLORCHANGE:
619 case WM_PSIZE:
620 case WM_PACTIVATE:
621 case WM_PCONTROL:
622 case WM_HELP:
623 case WM_APPTERMINATENOTIFY:
624 case WM_PRESPARAMCHANGED:
625 case WM_DRAWITEM:
626 case WM_MEASUREITEM:
627 case WM_CONTROLPOINTER:
628 case WM_QUERYDLGCODE:
629 case WM_SUBSTITUTESTRING:
630 case WM_MATCHMNEMONIC:
631 case WM_SAVEAPPLICATION:
632 case WM_SEMANTICEVENT:
633 default:
634// dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
635 RestoreOS2TIB();
636 return WinDefWindowProc( hwnd, msg, mp1, mp2 );
637 }
638 RestoreOS2TIB();
639 return (MRESULT)FALSE;
640
641RunDefWndProc:
642// dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
643 RestoreOS2TIB();
644 return WinDefWindowProc( hwnd, msg, mp1, mp2 );
645} /* End of Win32WindowProc */
646//******************************************************************************
647//******************************************************************************
Note: See TracBrowser for help on using the repository browser.