source: trunk/src/user32/window.cpp@ 1063

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

Dialog + error handling fixes

File size: 46.0 KB
Line 
1/* $Id: window.cpp,v 1.10 1999-09-26 14:44:58 sandervl Exp $ */
2/*
3 * Win32 window apis for OS/2
4 *
5 * Copyright 1999 Sander van Leeuwen
6 * Copyright 1999 Daniela Engert (dani@ngrt.de)
7 *
8 * Parts based on Wine Windows code (windows\win.c)
9 *
10 * Copyright 1993, 1994 Alexandre Julliard
11 *
12 * Project Odin Software License can be found in LICENSE.TXT
13 *
14 *
15 * TODO: Decide what to do about commands for OS/2 windows (non-Win32 apps)
16 *
17 */
18
19#include <os2win.h>
20#include <misc.h>
21#include <win32wbase.h>
22#include <win32wmdiclient.h>
23#include <win32wdesktop.h>
24#include <oslibwin.h>
25#include <oslibgdi.h>
26#include "user32.h"
27#include "winicon.h"
28
29//******************************************************************************
30//******************************************************************************
31#ifdef DEBUG
32void PrintWindowStyle(DWORD dwStyle, DWORD dwExStyle)
33{
34 char style[256] = "";
35 char exstyle[256] = "";
36
37 /* Window styles */
38 if(dwStyle & WS_CHILD)
39 strcat(style, "WS_CHILD ");
40 if(dwStyle & WS_POPUP)
41 strcat(style, "WS_POPUP ");
42 if(dwStyle & WS_VISIBLE)
43 strcat(style, "WS_VISIBLE ");
44 if(dwStyle & WS_DISABLED)
45 strcat(style, "WS_DISABLED ");
46 if(dwStyle & WS_CLIPSIBLINGS)
47 strcat(style, "WS_CLIPSIBLINGS ");
48 if(dwStyle & WS_CLIPCHILDREN)
49 strcat(style, "WS_CLIPCHILDREN ");
50 if(dwStyle & WS_MAXIMIZE)
51 strcat(style, "WS_MAXIMIZE ");
52 if(dwStyle & WS_MINIMIZE)
53 strcat(style, "WS_MINIMIZE ");
54 if(dwStyle & WS_GROUP)
55 strcat(style, "WS_GROUP ");
56 if(dwStyle & WS_TABSTOP)
57 strcat(style, "WS_TABSTOP ");
58
59 if(dwStyle & WS_CAPTION)
60 strcat(style, "WS_CAPTION ");
61 if(dwStyle & WS_DLGFRAME)
62 strcat(style, "WS_DLGFRAME ");
63 if(dwStyle & WS_BORDER)
64 strcat(style, "WS_BORDER ");
65
66 if(dwStyle & WS_VSCROLL)
67 strcat(style, "WS_VSCROLL ");
68 if(dwStyle & WS_HSCROLL)
69 strcat(style, "WS_HSCROLL ");
70 if(dwStyle & WS_SYSMENU)
71 strcat(style, "WS_SYSMENU ");
72 if(dwStyle & WS_THICKFRAME)
73 strcat(style, "WS_THICKFRAME ");
74 if(dwStyle & WS_MINIMIZEBOX)
75 strcat(style, "WS_MINIMIZEBOX ");
76 if(dwStyle & WS_MAXIMIZEBOX)
77 strcat(style, "WS_MAXIMIZEBOX ");
78
79 if(dwExStyle & WS_EX_DLGMODALFRAME)
80 strcat(exstyle, "WS_EX_DLGMODALFRAME ");
81 if(dwExStyle & WS_EX_ACCEPTFILES)
82 strcat(exstyle, "WS_EX_ACCEPTFILES ");
83 if(dwExStyle & WS_EX_NOPARENTNOTIFY)
84 strcat(exstyle, "WS_EX_NOPARENTNOTIFY ");
85 if(dwExStyle & WS_EX_TOPMOST)
86 strcat(exstyle, "WS_EX_TOPMOST ");
87 if(dwExStyle & WS_EX_TRANSPARENT)
88 strcat(exstyle, "WS_EX_TRANSPARENT ");
89
90 if(dwExStyle & WS_EX_MDICHILD)
91 strcat(exstyle, "WS_EX_MDICHILD ");
92 if(dwExStyle & WS_EX_TOOLWINDOW)
93 strcat(exstyle, "WS_EX_TOOLWINDOW ");
94 if(dwExStyle & WS_EX_WINDOWEDGE)
95 strcat(exstyle, "WS_EX_WINDOWEDGE ");
96 if(dwExStyle & WS_EX_CLIENTEDGE)
97 strcat(exstyle, "WS_EX_CLIENTEDGE ");
98 if(dwExStyle & WS_EX_CONTEXTHELP)
99 strcat(exstyle, "WS_EX_CONTEXTHELP ");
100 if(dwExStyle & WS_EX_RIGHT)
101 strcat(exstyle, "WS_EX_RIGHT ");
102 if(dwExStyle & WS_EX_LEFT)
103 strcat(exstyle, "WS_EX_LEFT ");
104 if(dwExStyle & WS_EX_RTLREADING)
105 strcat(exstyle, "WS_EX_RTLREADING ");
106 if(dwExStyle & WS_EX_LTRREADING)
107 strcat(exstyle, "WS_EX_LTRREADING ");
108 if(dwExStyle & WS_EX_LEFTSCROLLBAR)
109 strcat(exstyle, "WS_EX_LEFTSCROLLBAR ");
110 if(dwExStyle & WS_EX_RIGHTSCROLLBAR)
111 strcat(exstyle, "WS_EX_RIGHTSCROLLBAR ");
112 if(dwExStyle & WS_EX_CONTROLPARENT)
113 strcat(exstyle, "WS_EX_CONTROLPARENT ");
114 if(dwExStyle & WS_EX_STATICEDGE)
115 strcat(exstyle, "WS_EX_STATICEDGE ");
116 if(dwExStyle & WS_EX_APPWINDOW)
117 strcat(exstyle, "WS_EX_APPWINDOW ");
118
119 dprintf(("Window style: %x %s", dwStyle, style));
120 dprintf(("Window exStyle: %x %s", dwExStyle, exstyle));
121}
122#endif
123//******************************************************************************
124//******************************************************************************
125HWND WIN32API CreateWindowExA(DWORD exStyle, LPCSTR className,
126 LPCSTR windowName, DWORD style, INT x,
127 INT y, INT width, INT height,
128 HWND parent, HMENU menu,
129 HINSTANCE instance, LPVOID data )
130{
131 Win32BaseWindow *window;
132 ATOM classAtom;
133 CREATESTRUCTA cs;
134
135#ifdef DEBUG
136 PrintWindowStyle(style, exStyle);
137#endif
138
139 if(exStyle & WS_EX_MDICHILD)
140 return CreateMDIWindowA(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data);
141
142 //TODO: According to the docs className can be a 16 bits atom
143 // Wine seems to assume it's a string though...
144 /* Find the class atom */
145 if (!(classAtom = GlobalFindAtomA(className)))
146 {
147 dprintf(("CreateWindowEx32A: bad class name "));
148 if (!HIWORD(className)) {
149 dprintf(("CreateWindowEx32A: bad class name %04x\n", LOWORD(className)));
150 }
151 else dprintf(("CreateWindowEx32A: bad class name '%s'\n", className ));
152 SetLastError(ERROR_INVALID_PARAMETER);
153 return 0;
154 }
155
156 /* Create the window */
157 cs.lpCreateParams = data;
158 cs.hInstance = instance;
159 cs.hMenu = menu;
160 cs.hwndParent = parent;
161 cs.x = x;
162 cs.y = y;
163 cs.cx = width;
164 cs.cy = height;
165 cs.style = style;
166 cs.lpszName = windowName;
167 cs.lpszClass = className;
168 cs.dwExStyle = exStyle;
169 if(HIWORD(className)) {
170 dprintf(("CreateWindowExA: class %s parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
171 }
172 else dprintf(("CreateWindowExA: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
173
174 //TODO: According to the docs className can be a 16 bits atom
175 // Wine seems to assume it's a string though...
176 if(!stricmp(className, MDICLIENTCLASSNAMEA)) {
177 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, FALSE);
178 }
179 else {
180 window = new Win32BaseWindow( &cs, classAtom, FALSE );
181 }
182 if(window == NULL)
183 {
184 dprintf(("Win32BaseWindow creation failed!!"));
185 return 0;
186 }
187 if(GetLastError() != 0)
188 {
189 dprintf(("Win32BaseWindow error found!!"));
190 delete window;
191 return 0;
192 }
193 return window->getWindowHandle();
194}
195//******************************************************************************
196//******************************************************************************
197HWND WIN32API CreateWindowExW(DWORD exStyle, LPCWSTR className,
198 LPCWSTR windowName, DWORD style, INT x,
199 INT y, INT width, INT height,
200 HWND parent, HMENU menu,
201 HINSTANCE instance, LPVOID data )
202{
203 Win32BaseWindow *window;
204 ATOM classAtom;
205 CREATESTRUCTA cs;
206
207 if(exStyle & WS_EX_MDICHILD)
208 return CreateMDIWindowW(className, windowName, style, x, y, width, height, parent, instance, (LPARAM)data);
209
210 //TODO: According to the docs className can be a 16 bits atom
211 // Wine seems to assume it's a string though...
212 /* Find the class atom */
213 if (!(classAtom = GlobalFindAtomW(className)))
214 {
215 dprintf(("CreateWindowEx32A: bad class name "));
216 if (!HIWORD(className)) {
217 dprintf(("CreateWindowEx32A: bad class name %04x\n", LOWORD(className)));
218 }
219// else dprintf(("CreateWindowEx32A: bad class name '%s'\n", className ));
220 SetLastError(ERROR_INVALID_PARAMETER);
221 return 0;
222 }
223
224 /* Create the window */
225 cs.lpCreateParams = data;
226 cs.hInstance = instance;
227 cs.hMenu = menu;
228 cs.hwndParent = parent;
229 cs.x = x;
230 cs.y = y;
231 cs.cx = width;
232 cs.cy = height;
233 cs.style = style;
234 cs.lpszName = (LPSTR)windowName;
235 cs.lpszClass = (LPSTR)className;
236 cs.dwExStyle = exStyle;
237
238 //TODO: According to the docs className can be a 16 bits atom
239 // Wine seems to assume it's a string though...
240 if(!lstrcmpW(className, (LPWSTR)MDICLIENTCLASSNAMEW)) {
241 window = (Win32BaseWindow *) new Win32MDIClientWindow(&cs, classAtom, TRUE);
242 }
243 else {
244 window = new Win32BaseWindow( &cs, classAtom, TRUE );
245 }
246 if(window == NULL)
247 {
248 dprintf(("Win32BaseWindow creation failed!!"));
249 return 0;
250 }
251 if(GetLastError() != 0)
252 {
253 dprintf(("Win32BaseWindow error found!!"));
254 delete window;
255 return 0;
256 }
257 return window->getWindowHandle();
258}
259//******************************************************************************
260//******************************************************************************
261HWND WIN32API CreateMDIWindowA(LPCSTR lpszClassName, LPCSTR lpszWindowName,
262 DWORD dwStyle, int x, int y, int nWidth,
263 int nHeight, HWND hwndParent,
264 HINSTANCE hInstance, LPARAM lParam )
265{
266 HWND hwnd;
267 MDICREATESTRUCTA cs;
268 Win32BaseWindow *window;
269
270 window = Win32BaseWindow::GetWindowFromHandle(hwndParent);
271 if(!window) {
272 dprintf(("CreateMDIWindowA, window %x not found", hwndParent));
273 return 0;
274 }
275
276 dprintf(("USER32: CreateMDIWindowA\n"));
277 cs.szClass = lpszClassName;
278 cs.szTitle = lpszWindowName;
279 cs.hOwner = hInstance;
280 cs.x = x;
281 cs.y = y;
282 cs.cx = nHeight;
283 cs.cy = nWidth;
284 cs.style = dwStyle;
285 cs.lParam = lParam;
286
287 return window->SendMessageA(WM_MDICREATE, 0, (LPARAM)&cs);
288}
289//******************************************************************************
290//******************************************************************************
291HWND WIN32API CreateMDIWindowW(LPCWSTR lpszClassName, LPCWSTR lpszWindowName,
292 DWORD dwStyle, int x, int y, int nWidth,
293 int nHeight, HWND hwndParent,
294 HINSTANCE hInstance, LPARAM lParam )
295{
296 HWND hwnd;
297 MDICREATESTRUCTW cs;
298 Win32BaseWindow *window;
299
300 window = Win32BaseWindow::GetWindowFromHandle(hwndParent);
301 if(!window) {
302 dprintf(("CreateMDIWindowW, window %x not found", hwndParent));
303 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
304 return 0;
305 }
306
307 dprintf(("USER32: CreateMDIWindowW\n"));
308 cs.szClass = lpszClassName;
309 cs.szTitle = lpszWindowName;
310 cs.hOwner = hInstance;
311 cs.x = x;
312 cs.y = y;
313 cs.cx = nHeight;
314 cs.cy = nWidth;
315 cs.style = dwStyle;
316 cs.lParam = lParam;
317
318 return window->SendMessageW(WM_MDICREATE, 0, (LPARAM)&cs);
319}
320//******************************************************************************
321//******************************************************************************
322BOOL WIN32API DestroyWindow(HWND hwnd)
323{
324 Win32BaseWindow *window;
325
326 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
327 if(!window) {
328 dprintf(("DestroyWindow, window %x not found", hwnd));
329 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
330 return 0;
331 }
332 dprintf(("DestroyWindow %x", hwnd));
333 return window->DestroyWindow();
334}
335//******************************************************************************
336//******************************************************************************
337HWND WIN32API SetActiveWindow( HWND hwnd)
338{
339 Win32BaseWindow *window;
340
341 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
342 if(!window) {
343 dprintf(("SetActiveWindow, window %x not found", hwnd));
344 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
345 return 0;
346 }
347 dprintf(("SetActiveWindow %x", hwnd));
348 return window->SetActiveWindow();
349}
350//******************************************************************************
351//******************************************************************************
352HWND WIN32API GetParent( HWND hwnd)
353{
354 Win32BaseWindow *window;
355
356 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
357 if(!window) {
358 dprintf(("GetParent, window %x not found", hwnd));
359 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
360 return 0;
361 }
362 dprintf(("GetParent %x", hwnd));
363 return window->GetParent();
364}
365//******************************************************************************
366//******************************************************************************
367HWND WIN32API SetParent( HWND hwndChild, HWND hwndNewParent)
368{
369 Win32BaseWindow *window;
370
371 window = Win32BaseWindow::GetWindowFromHandle(hwndChild);
372 if(!window) {
373 dprintf(("SetParent, window %x not found", hwndChild));
374 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
375 return 0;
376 }
377 dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
378 return window->SetParent(hwndNewParent);
379}
380//******************************************************************************
381//******************************************************************************
382BOOL WIN32API IsChild( HWND hwndParent, HWND hwnd)
383{
384 Win32BaseWindow *window;
385
386 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
387 if(!window) {
388 dprintf(("IsChild, window %x not found", hwnd));
389 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
390 return 0;
391 }
392 dprintf(("IsChild %x %x", hwndParent, hwnd));
393 return window->IsChild(hwndParent);
394}
395//******************************************************************************
396//******************************************************************************
397HWND WIN32API GetTopWindow( HWND hwnd)
398{
399 Win32BaseWindow *window;
400
401 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
402 if(!window) {
403 dprintf(("GetTopWindow, window %x not found", hwnd));
404 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
405 return 0;
406 }
407 dprintf(("GetTopWindow %x", hwnd));
408 return window->GetTopWindow();
409}
410//******************************************************************************
411//******************************************************************************
412#if 0
413BOOL WIN32API UpdateWindow(HWND hwnd)
414{
415 Win32BaseWindow *window;
416
417 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
418 if(!window) {
419 dprintf(("UpdateWindow, window %x not found", hwnd));
420 return 0;
421 }
422 dprintf(("UpdateWindow %x", hwnd));
423 return window->UpdateWindow();
424}
425#endif
426//******************************************************************************
427//******************************************************************************
428BOOL WIN32API IsIconic( HWND hwnd)
429{
430 Win32BaseWindow *window;
431
432 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
433 if(!window) {
434 dprintf(("IsIconic, window %x not found", hwnd));
435 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
436 return 0;
437 }
438 dprintf(("IsIconic %x", hwnd));
439 return window->IsIconic();
440}
441//******************************************************************************
442//******************************************************************************
443HWND WIN32API GetWindow(HWND hwnd, UINT uCmd)
444{
445 Win32BaseWindow *window;
446
447 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
448 if(!window) {
449 dprintf(("GetWindow, window %x not found", hwnd));
450 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
451 return 0;
452 }
453 dprintf(("GetWindow %x %d", hwnd, uCmd));
454 return window->GetWindow(uCmd);
455}
456//******************************************************************************
457//******************************************************************************
458BOOL WIN32API EnableWindow( HWND hwnd, BOOL fEnable)
459{
460 Win32BaseWindow *window;
461
462 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
463 if(!window) {
464 dprintf(("EnableWindow, window %x not found", hwnd));
465 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
466 return 0;
467 }
468 dprintf(("EnableWindow %x %d", hwnd, fEnable));
469 return window->EnableWindow(fEnable);
470}
471//******************************************************************************
472//******************************************************************************
473BOOL WIN32API BringWindowToTop(HWND hwnd)
474{
475 return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
476}
477//******************************************************************************
478//******************************************************************************
479HWND WIN32API GetActiveWindow()
480{
481 return Win32BaseWindow::GetActiveWindow();
482}
483//******************************************************************************
484//******************************************************************************
485BOOL WIN32API ShowWindow(HWND hwnd, int nCmdShow)
486{
487 Win32BaseWindow *window;
488
489 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
490 if(!window) {
491 dprintf(("ShowWindow, window %x not found", hwnd));
492 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
493 return 0;
494 }
495 dprintf(("ShowWindow %x", hwnd));
496 return window->ShowWindow(nCmdShow);
497}
498//******************************************************************************
499//******************************************************************************
500BOOL WIN32API SetWindowPos(HWND hwnd, HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags)
501{
502 Win32BaseWindow *window;
503
504 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
505 if(!window) {
506 dprintf(("SetWindowPos, window %x not found", hwnd));
507 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
508 return 0;
509 }
510 dprintf(("SetWindowPos %x %x x=%d y=%d cx=%d cy=%d %x", hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
511 return window->SetWindowPos(hwndInsertAfter, x, y, cx, cy, fuFlags);
512}
513//******************************************************************************
514//******************************************************************************
515BOOL WIN32API SetWindowPlacement( HWND arg1, const WINDOWPLACEMENT * arg2)
516{
517 dprintf(("USER32: SetWindowPlacement\n"));
518 return O32_SetWindowPlacement(arg1, arg2);
519}
520//******************************************************************************
521//******************************************************************************
522BOOL WIN32API GetWindowPlacement( HWND arg1, LPWINDOWPLACEMENT arg2)
523{
524#ifdef DEBUG
525 WriteLog("USER32: GetWindowPlacement\n");
526#endif
527 return O32_GetWindowPlacement(arg1, arg2);
528}
529//******************************************************************************
530//******************************************************************************
531BOOL WIN32API IsWindow( HWND hwnd)
532{
533 Win32BaseWindow *window;
534
535 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
536 if(!window) {
537 dprintf(("IsWindow, window %x not found", hwnd));
538 return FALSE;
539 }
540 dprintf(("IsWindow %x", hwnd));
541 return window->IsWindow();
542}
543//******************************************************************************
544//******************************************************************************
545BOOL WIN32API IsWindowEnabled( HWND hwnd)
546{
547 Win32BaseWindow *window;
548
549 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
550 if(!window) {
551 dprintf(("IsWindowEnabled, window %x not found", hwnd));
552 return 0;
553 }
554 dprintf(("IsWindowEnabled %x", hwnd));
555 return window->IsWindowEnabled();
556}
557//******************************************************************************
558//******************************************************************************
559BOOL WIN32API IsWindowVisible( HWND hwnd)
560{
561 Win32BaseWindow *window;
562
563 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
564 if(!window) {
565 dprintf(("IsWindowVisible, window %x not found", hwnd));
566 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
567 return 0;
568 }
569 dprintf(("IsWindowVisible %x", hwnd));
570 return window->IsWindowVisible();
571}
572//******************************************************************************
573//******************************************************************************
574HWND WIN32API SetFocus (HWND hwnd)
575{
576 HWND lastFocus, lastFocus_W, hwnd_O;
577 BOOL activate;
578
579 hwnd_O = Win32BaseWindow::Win32ToOS2Handle (hwnd);
580 lastFocus = OSLibWinQueryFocus (OSLIB_HWND_DESKTOP);
581 activate = ((hwnd_O == lastFocus) || OSLibWinIsChild (lastFocus, hwnd_O));
582 lastFocus_W = Win32BaseWindow::OS2ToWin32Handle (lastFocus);
583
584 dprintf(("SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O));
585
586 return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
587}
588//******************************************************************************
589//******************************************************************************
590HWND WIN32API GetFocus(void)
591{
592 HWND hwnd;
593// dprintf(("USER32: GetFocus\n"));
594
595 hwnd = OSLibWinQueryFocus(OSLIB_HWND_DESKTOP);
596 return Win32BaseWindow::OS2ToWin32Handle(hwnd);
597}
598//******************************************************************************
599//******************************************************************************
600/***********************************************************************
601 * GetInternalWindowPos (USER32.245)
602 */
603UINT WIN32API GetInternalWindowPos(HWND hwnd,
604 LPRECT rectWnd,
605 LPPOINT ptIcon )
606{
607 WINDOWPLACEMENT wndpl;
608
609 dprintf(("USER32: GetInternalWindowPos(%08xh,%08xh,%08xh)\n",
610 hwnd,
611 rectWnd,
612 ptIcon));
613
614 if (GetWindowPlacement( hwnd, &wndpl ))
615 {
616 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
617 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
618 return wndpl.showCmd;
619 }
620 return 0;
621}
622//******************************************************************************
623//******************************************************************************
624BOOL WIN32API IsZoomed( HWND arg1)
625{
626#ifdef DEBUG
627 WriteLog("USER32: IsZoomed\n");
628#endif
629 return O32_IsZoomed(arg1);
630}
631//******************************************************************************
632//******************************************************************************
633BOOL WIN32API LockWindowUpdate( HWND arg1)
634{
635#ifdef DEBUG
636 WriteLog("USER32: LockWindowUpdate\n");
637#endif
638 return O32_LockWindowUpdate(arg1);
639}
640//******************************************************************************
641//******************************************************************************
642
643#if 0
644BOOL WIN32API RedrawWindow( HWND arg1, const RECT * arg2, HRGN arg3, UINT arg4)
645{
646 BOOL rc;
647
648 rc = O32_RedrawWindow(arg1, arg2, arg3, arg4);
649#ifdef DEBUG
650 WriteLog("USER32: RedrawWindow %X , %X, %X, %X returned %d\n", arg1, arg2, arg3, arg4, rc);
651#endif
652 InvalidateRect(arg1, arg2, TRUE);
653 UpdateWindow(arg1);
654 SendMessageA(arg1, WM_PAINT, 0, 0);
655 return(rc);
656}
657#endif
658//******************************************************************************
659//******************************************************************************
660BOOL WIN32API GetWindowRect( HWND hwnd, PRECT pRect)
661{
662 Win32BaseWindow *window;
663
664 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
665 if(!window) {
666 dprintf(("GetWindowRect, window %x not found", hwnd));
667 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
668 return 0;
669 }
670 dprintf(("GetWindowRect %x", hwnd));
671 return window->GetWindowRect(pRect);
672}
673//******************************************************************************
674//******************************************************************************
675int WIN32API GetWindowTextLengthA( HWND hwnd)
676{
677 Win32BaseWindow *window;
678
679 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
680 if(!window) {
681 dprintf(("GetWindowTextLength, window %x not found", hwnd));
682 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
683 return 0;
684 }
685 dprintf(("GetWindowTextLength %x", hwnd));
686 return window->GetWindowTextLength();
687}
688//******************************************************************************
689//******************************************************************************
690int WIN32API GetWindowTextA( HWND hwnd, LPSTR lpsz, int cch)
691{
692 Win32BaseWindow *window;
693 int rc;
694
695 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
696 if(!window) {
697 dprintf(("GetWindowTextA, window %x not found", hwnd));
698 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
699 return 0;
700 }
701 rc = window->GetWindowTextA(lpsz, cch);
702 dprintf(("GetWindowTextA %x %s", hwnd, lpsz));
703 return rc;
704}
705//******************************************************************************
706//******************************************************************************
707int WIN32API GetWindowTextLengthW( HWND hwnd)
708{
709 dprintf(("USER32: GetWindowTextLengthW\n"));
710 return GetWindowTextLengthA(hwnd);
711}
712//******************************************************************************
713//******************************************************************************
714int WIN32API GetWindowTextW(HWND hwnd, LPWSTR lpsz, int cch)
715{
716 Win32BaseWindow *window;
717
718 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
719 if(!window) {
720 dprintf(("GetWindowTextW, window %x not found", hwnd));
721 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
722 return 0;
723 }
724 dprintf(("GetWindowTextW %x", hwnd));
725 return window->GetWindowTextW(lpsz, cch);
726}
727//******************************************************************************
728//******************************************************************************
729BOOL WIN32API SetWindowTextA(HWND hwnd, LPCSTR lpsz)
730{
731 Win32BaseWindow *window;
732
733 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
734 if(!window) {
735 dprintf(("SetWindowTextA, window %x not found", hwnd));
736 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
737 return 0;
738 }
739 dprintf(("SetWindowTextA %x %s", hwnd, lpsz));
740 return window->SetWindowTextA((LPSTR)lpsz);
741}
742//******************************************************************************
743//******************************************************************************
744BOOL WIN32API SetWindowTextW( HWND hwnd, LPCWSTR lpsz)
745{
746 Win32BaseWindow *window;
747
748 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
749 if(!window) {
750 dprintf(("SetWindowTextA, window %x not found", hwnd));
751 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
752 return 0;
753 }
754 dprintf(("SetWindowTextW %x", hwnd));
755 return window->SetWindowTextW((LPWSTR)lpsz);
756}
757/*******************************************************************
758 * InternalGetWindowText (USER32.326)
759 */
760int WIN32API InternalGetWindowText(HWND hwnd,
761 LPWSTR lpString,
762 INT nMaxCount )
763{
764 dprintf(("USER32: InternalGetWindowText(%08xh,%08xh,%08xh) not properly implemented.\n",
765 hwnd,
766 lpString,
767 nMaxCount));
768
769 return GetWindowTextW(hwnd,lpString,nMaxCount);
770}
771//******************************************************************************
772//TODO: Correct?
773//******************************************************************************
774BOOL WIN32API SetForegroundWindow(HWND hwnd)
775{
776 dprintf((" SetForegroundWindow %x", hwnd));
777
778 return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER );
779}
780//******************************************************************************
781//******************************************************************************
782BOOL WIN32API GetClientRect( HWND hwnd, PRECT pRect)
783{
784 BOOL rc;
785
786 hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
787 rc = OSLibWinQueryWindowRect(hwnd, pRect);
788 dprintf(("USER32: GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
789 return rc;
790}
791//******************************************************************************
792//******************************************************************************
793BOOL WIN32API AdjustWindowRect( PRECT arg1, DWORD arg2, BOOL arg3)
794{
795#ifdef DEBUG
796 WriteLog("USER32: AdjustWindowRect\n");
797#endif
798 return O32_AdjustWindowRect(arg1, arg2, arg3);
799}
800//******************************************************************************
801//******************************************************************************
802BOOL WIN32API AdjustWindowRectEx( PRECT arg1, DWORD arg2, BOOL arg3, DWORD arg4)
803{
804#ifdef DEBUG
805 WriteLog("USER32: AdjustWindowRectEx\n");
806#endif
807 return O32_AdjustWindowRectEx(arg1, arg2, arg3, arg4);
808}
809//******************************************************************************
810//******************************************************************************
811HWND WIN32API GetDesktopWindow(void)
812{
813 dprintf(("USER32: GetDesktopWindow\n"));
814 return windowDesktop->getWindowHandle();
815}
816//******************************************************************************
817//******************************************************************************
818HWND WIN32API FindWindowA(LPCSTR lpszClass, LPCSTR lpszWindow)
819{
820 if(!lpszClass) {
821 SetLastError(ERROR_INVALID_PARAMETER);
822 return 0;
823 }
824 if(HIWORD(lpszClass)) {
825 dprintf(("USER32: FindWindow %s %s\n", lpszClass, lpszWindow));
826 }
827 else dprintf(("USER32: FindWindow %x %s\n", lpszClass, lpszWindow));
828
829 return Win32BaseWindow::FindWindowEx(OSLIB_HWND_DESKTOP, 0, (LPSTR)lpszClass, (LPSTR)lpszWindow);
830}
831//******************************************************************************
832//******************************************************************************
833HWND WIN32API FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow)
834{
835 if(!lpszClass) {
836 SetLastError(ERROR_INVALID_PARAMETER);
837 return 0;
838 }
839 if(HIWORD(lpszClass)) {
840 dprintf(("USER32: FindWindowExA (%x,%x) %s %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
841 }
842 else dprintf(("USER32: FindWindowExA (%x,%x)%x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
843
844 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
845}
846/*****************************************************************************
847 * Name : HWND WIN32API FindWindowExW
848 * Purpose : The FindWindowEx function retrieves the handle of a window whose
849 * class name and window name match the specified strings. The
850 * function searches child windows, beginning with the one following
851 * the given child window.
852 * Parameters: HWND hwndParent handle of parent window
853 * HWND hwndChildAfter handle of a child window
854 * LPCTSTR lpszClass address of class name
855 * LPCTSTR lpszWindow address of window name
856 * Variables :
857 * Result : If the function succeeds, the return value is the handle of the
858 * window that has the specified class and window names.
859 * If the function fails, the return value is NULL. To get extended
860 * error information, call GetLastError.
861 * Remark :
862 * Status : UNTESTED STUB
863 *
864 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
865 *****************************************************************************/
866
867HWND WIN32API FindWindowExW(HWND hwndParent,
868 HWND hwndChildAfter,
869 LPCWSTR lpszClass,
870 LPCWSTR lpszWindow)
871{
872 if(!lpszClass) {
873 SetLastError(ERROR_INVALID_PARAMETER);
874 return 0;
875 }
876 dprintf(("USER32: FindWindowExW (%x,%x) %x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
877
878 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
879}
880//******************************************************************************
881//******************************************************************************
882BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
883{
884 dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
885 return OSLibWinFlashWindow(Win32BaseWindow::Win32ToOS2Handle(hwnd), fFlash);
886}
887//******************************************************************************
888//******************************************************************************
889BOOL WIN32API MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
890 BOOL repaint )
891{
892 int flags = SWP_NOZORDER | SWP_NOACTIVATE;
893
894 if (!repaint) flags |= SWP_NOREDRAW;
895 dprintf(("MoveWindow: %04x %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint ));
896
897 return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
898}
899//******************************************************************************
900//******************************************************************************
901BOOL WIN32API ClientToScreen (HWND hwnd, PPOINT pt)
902{
903#ifdef DEBUG
904 WriteLog("USER32: ClientToScreen\n");
905#endif
906 Win32BaseWindow *wnd;
907 PRECT rcl;
908
909 if (!hwnd) {
910 SetLastError(ERROR_INVALID_PARAMETER);
911 return (FALSE);
912 }
913 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
914 if (!wnd) {
915 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
916 return (FALSE);
917 }
918
919 rcl = wnd->getClientRect();
920 pt->y = (rcl->bottom - rcl->top) - pt->y;
921 OSLibWinMapWindowPoints (wnd->getOS2WindowHandle(), OSLIB_HWND_DESKTOP, (OSLIBPOINT *)pt, 1);
922 pt->y = ScreenHeight - pt->y;
923 return (TRUE);
924}
925//******************************************************************************
926//******************************************************************************
927HDWP WIN32API BeginDeferWindowPos( int arg1)
928{
929#ifdef DEBUG
930 WriteLog("USER32: BeginDeferWindowPos\n");
931#endif
932 return O32_BeginDeferWindowPos(arg1);
933}
934//******************************************************************************
935//******************************************************************************
936HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND arg3, int arg4, int arg5, int arg6, int arg7, UINT arg8)
937{
938#ifdef DEBUG
939 WriteLog("USER32: DeferWindowPos\n");
940#endif
941 return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
942}
943//******************************************************************************
944//******************************************************************************
945HWND WIN32API ChildWindowFromPoint( HWND hwnd, POINT pt)
946{
947 dprintf(("USER32: ChildWindowFromPoint\n"));
948// return O32_ChildWindowFromPoint(arg1, arg2);
949 return ChildWindowFromPointEx(hwnd, pt, 0);
950}
951//******************************************************************************
952//******************************************************************************
953/*****************************************************************************
954 * Name : HWND WIN32API ChildWindowFromPointEx
955 * Purpose : The GetWindowRect function retrieves the dimensions of the
956 * bounding rectangle of the specified window. The dimensions are
957 * given in screen coordinates that are relative to the upper-left
958 * corner of the screen.
959 * Parameters:
960 * Variables :
961 * Result : If the function succeeds, the return value is the window handle.
962 * If the function fails, the return value is zero
963 * Remark :
964 * Status : FULLY IMPLEMENTED AND TESTED
965 *
966 * Author : Rene Pronk [Sun, 1999/08/08 23:30]
967 *****************************************************************************/
968
969HWND WIN32API ChildWindowFromPointEx (HWND hwndParent, POINT pt, UINT uFlags)
970{
971 RECT rect;
972 HWND hWnd;
973 POINT absolutePt;
974
975 dprintf(("ChildWindowFromPointEx(%08xh,%08xh,%08xh).\n",
976 hwndParent, pt, uFlags));
977
978 if (GetWindowRect (hwndParent, &rect) == 0) {
979 // oops, invalid handle
980 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
981 return NULL;
982 }
983
984 // absolutePt has its top in the upper-left corner of the screen
985 absolutePt = pt;
986 ClientToScreen (hwndParent, &absolutePt);
987
988 // make rect the size of the parent window
989 GetWindowRect (hwndParent, &rect);
990 rect.right = rect.right - rect.left;
991 rect.bottom = rect.bottom - rect.top;
992 rect.left = 0;
993 rect.top = 0;
994
995 if (PtInRect (&rect, pt) == 0) {
996 // point is outside window
997 return NULL;
998 }
999
1000 // get first child
1001 hWnd = GetWindow (hwndParent, GW_CHILD);
1002
1003 while (hWnd != NULL) {
1004
1005 // do I need to skip this window?
1006 if (((uFlags & CWP_SKIPINVISIBLE) &&
1007 (IsWindowVisible (hWnd) == FALSE)) ||
1008 ((uFlags & CWP_SKIPDISABLED) &&
1009 (IsWindowEnabled (hWnd) == FALSE)) ||
1010 ((uFlags & CWP_SKIPTRANSPARENT) &&
1011 (GetWindowLongA (hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
1012
1013 {
1014 hWnd = GetWindow (hWnd, GW_HWNDNEXT);
1015 continue;
1016 }
1017
1018 // is the point in this window's rect?
1019 GetWindowRect (hWnd, &rect);
1020 if (PtInRect (&rect, absolutePt) == FALSE) {
1021 hWnd = GetWindow (hWnd, GW_HWNDNEXT);
1022 continue;
1023 }
1024
1025 dprintf(("ChildWindowFromPointEx returned %x", hWnd));
1026 // found it!
1027 return hWnd;
1028 }
1029
1030 // the point is in the parentwindow but the parentwindow has no child
1031 // at this coordinate
1032 dprintf(("ChildWindowFromPointEx returned parent %x", hwndParent));
1033 return hwndParent;
1034}
1035//******************************************************************************
1036//******************************************************************************
1037BOOL WIN32API CloseWindow(HWND hwnd)
1038{
1039 Win32BaseWindow *window;
1040
1041 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
1042 if(!window) {
1043 dprintf(("CloseWindow, window %x not found", hwnd));
1044 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1045 return 0;
1046 }
1047 dprintf(("CloseWindow %x\n", hwnd));
1048 return window->CloseWindow();
1049}
1050//******************************************************************************
1051//TODO: Does this return handles of hidden or disabled windows?
1052//******************************************************************************
1053HWND WIN32API WindowFromPoint( POINT point)
1054{
1055 HWND hwnd;
1056
1057 dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
1058 hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
1059 if(hwnd) {
1060 return Win32BaseWindow::OS2ToWin32Handle(hwnd);
1061 }
1062 return 0;
1063}
1064//******************************************************************************
1065//******************************************************************************
1066BOOL WIN32API IsWindowUnicode(HWND hwnd)
1067{
1068 Win32BaseWindow *window;
1069
1070 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
1071 if(!window) {
1072 dprintf(("IsWindowUnicode, window %x not found", hwnd));
1073 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1074 return 0;
1075 }
1076 return window->IsUnicode();
1077}
1078/*****************************************************************************
1079 * Name : WORD WIN32API CascadeWindows
1080 * Purpose : The CascadeWindows function cascades the specified windows or
1081 * the child windows of the specified parent window.
1082 * Parameters: HWND hwndParent handle of parent window
1083 * UINT wHow types of windows not to arrange
1084 * CONST RECT * lpRect rectangle to arrange windows in
1085 * UINT cKids number of windows to arrange
1086 * const HWND FAR * lpKids array of window handles
1087 * Variables :
1088 * Result : If the function succeeds, the return value is the number of windows arranged.
1089 * If the function fails, the return value is zero.
1090 * Remark :
1091 * Status : UNTESTED STUB
1092 *
1093 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1094 *****************************************************************************/
1095
1096WORD WIN32API CascadeWindows(HWND hwndParent,
1097 UINT wHow,
1098 CONST LPRECT lpRect,
1099 UINT cKids,
1100 const HWND *lpKids)
1101{
1102 dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
1103 hwndParent,
1104 wHow,
1105 lpRect,
1106 cKids,
1107 lpKids));
1108
1109 return (0);
1110}
1111/*****************************************************************************
1112 * Name : BOOL WIN32API SwitchToThisWindow
1113 * Purpose : Unknown
1114 * Parameters: Unknown
1115 * Variables :
1116 * Result :
1117 * Remark :
1118 * Status : UNTESTED UNKNOWN STUB
1119 *
1120 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
1121 *****************************************************************************/
1122
1123BOOL WIN32API SwitchToThisWindow(HWND hwnd,
1124 BOOL x2)
1125{
1126 dprintf(("USER32: SwitchToThisWindow(%08xh,%08xh) not implemented.\n",
1127 hwnd,
1128 x2));
1129
1130 return (FALSE); /* default */
1131}
1132//******************************************************************************
1133//******************************************************************************
1134BOOL WIN32API EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam)
1135{
1136 Win32BaseWindow *window;
1137 BOOL rc;
1138 ULONG henum;
1139 HWND hwndNext;
1140 ULONG tid;
1141 ULONG pid, curpid;
1142
1143 dprintf(("EnumThreadWindows\n"));
1144
1145 curpid = GetCurrentProcessId();
1146
1147 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
1148 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1149 {
1150 OSLibWinQueryWindowProcess(hwndNext, &pid, &tid);
1151 if(!(curpid == pid && dwThreadId == tid))
1152 continue;
1153
1154 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1155 if(window == NULL) {
1156 //OS/2 window or non-frame window, so skip it
1157 continue;
1158 }
1159 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE)
1160 break;
1161 }
1162 OSLibWinEndEnumWindows (henum);
1163 return TRUE;
1164}
1165//******************************************************************************
1166//******************************************************************************
1167BOOL WIN32API EnumChildWindows(HWND hwnd, WNDENUMPROC lpfn, LPARAM lParam)
1168{
1169 Win32BaseWindow *window, *parentwindow;
1170 BOOL rc = TRUE;
1171 ULONG henum;
1172 HWND hwndNext;
1173
1174 dprintf(("EnumChildWindows %x %x\n", hwnd, lParam));
1175
1176 parentwindow = Win32BaseWindow::GetWindowFromHandle(hwnd);
1177 if(!parentwindow) {
1178 dprintf(("EnumChildWindows, window %x not found", hwnd));
1179 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1180 return FALSE;
1181 }
1182
1183 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
1184 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1185 {
1186 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1187 if(window == NULL) {
1188 //OS/2 window or non-frame window, so skip it
1189 continue;
1190 }
1191 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE)
1192 {
1193 rc = FALSE;
1194 break;
1195 }
1196 }
1197 OSLibWinEndEnumWindows(henum);
1198 return rc;
1199}
1200//******************************************************************************
1201//******************************************************************************
1202BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
1203{
1204 Win32BaseWindow *window;
1205 BOOL rc;
1206 ULONG henum;
1207 HWND hwndNext, hwndParent = OSLIB_HWND_DESKTOP;
1208
1209 dprintf(("EnumThreadWindows\n"));
1210
1211 do {
1212 henum = OSLibWinBeginEnumWindows(hwndParent);
1213 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1214 {
1215 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1216 if(window == NULL) {
1217 //OS/2 window or non-frame window, so skip it
1218 continue;
1219 }
1220 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) {
1221 goto Abort;
1222 }
1223 }
1224 if(hwndParent == OSLIB_HWND_OBJECT)
1225 break;
1226 hwndParent = OSLIB_HWND_OBJECT;
1227 OSLibWinEndEnumWindows(henum);
1228 }
1229 while(TRUE);
1230
1231Abort:
1232 OSLibWinEndEnumWindows(henum);
1233 return TRUE;
1234}
1235//******************************************************************************
1236//******************************************************************************
1237#if 0
1238BOOL WIN32API GetUpdateRect( HWND hwnd, PRECT lpRect, BOOL bErase)
1239{
1240 dprintf(("GetUpdateRect %x %d\n", hwnd, bErase));
1241 if (!lpRect) return FALSE;
1242
1243 return OSLibWinQueryUpdateRect(Win32BaseWindow::Win32ToOS2Handle(hwnd), lpRect);
1244}
1245#endif
1246//******************************************************************************
1247//******************************************************************************
1248#if 0
1249BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase)
1250{
1251#ifdef DEBUG
1252 if(lpRect)
1253 WriteLog("USER32: InvalidateRect for window %X (%d,%d)(%d,%d) %d\n", hWnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase);
1254 else WriteLog("USER32: InvalidateRect for window %X NULL, %d\n", hWnd, bErase);
1255#endif
1256
1257 //CB: bErase no quite the same
1258 hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
1259 if (lpRect)
1260 {
1261 return OSLibWinInvalidateRect(hWnd, (PRECT)lpRect, bErase);
1262 }
1263 else return OSLibWinInvalidateRect(hWnd,NULL,bErase);
1264}
1265#endif
1266//******************************************************************************
1267//******************************************************************************
1268UINT WIN32API ArrangeIconicWindows( HWND arg1)
1269{
1270#ifdef DEBUG
1271 WriteLog("USER32: ArrangeIconicWindows\n");
1272#endif
1273 return O32_ArrangeIconicWindows(arg1);
1274}
1275//******************************************************************************
1276//restores iconized window to previous size/position
1277//******************************************************************************
1278BOOL WIN32API OpenIcon(HWND hwnd)
1279{
1280#ifdef DEBUG
1281 WriteLog("USER32: OpenIcon\n");
1282#endif
1283 if(!IsIconic(hwnd))
1284 return FALSE;
1285 ShowWindow(hwnd, SW_SHOWNORMAL);
1286 return TRUE;
1287}
1288//******************************************************************************
1289//******************************************************************************
1290BOOL WIN32API ShowOwnedPopups( HWND arg1, BOOL arg2)
1291{
1292 dprintf(("USER32: ShowOwnedPopups\n"));
1293 return O32_ShowOwnedPopups(arg1, arg2);
1294}
1295//******************************************************************************
1296//******************************************************************************
1297
Note: See TracBrowser for help on using the repository browser.