source: trunk/src/user32/pmwindow.cpp@ 1000

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

erase background/paint stuff enhanced

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