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

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

EB's fixes + scrollbar changes

File size: 46.4 KB
Line 
1/* $Id: window.cpp,v 1.11 1999-10-07 09:28:02 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(!strcmpi(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(!lstrcmpiW(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#if 1
787 hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
788 rc = OSLibWinQueryWindowRect(hwnd, pRect);
789 dprintf(("USER32: GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
790 return rc;
791#else
792 Win32BaseWindow *window;
793
794 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
795 if(!window) {
796 dprintf(("GetClientRect, window %x not found", hwnd));
797 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
798 return 0;
799 }
800 *pRect = *window->getClientRect();
801 dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
802 return TRUE;
803#endif
804}
805//******************************************************************************
806//******************************************************************************
807BOOL WIN32API AdjustWindowRect( PRECT arg1, DWORD arg2, BOOL arg3)
808{
809#ifdef DEBUG
810 WriteLog("USER32: AdjustWindowRect\n");
811#endif
812 return O32_AdjustWindowRect(arg1, arg2, arg3);
813}
814//******************************************************************************
815//******************************************************************************
816BOOL WIN32API AdjustWindowRectEx( PRECT arg1, DWORD arg2, BOOL arg3, DWORD arg4)
817{
818#ifdef DEBUG
819 WriteLog("USER32: AdjustWindowRectEx\n");
820#endif
821 return O32_AdjustWindowRectEx(arg1, arg2, arg3, arg4);
822}
823//******************************************************************************
824//******************************************************************************
825HWND WIN32API GetDesktopWindow(void)
826{
827 dprintf(("USER32: GetDesktopWindow\n"));
828 return windowDesktop->getWindowHandle();
829}
830//******************************************************************************
831//******************************************************************************
832HWND WIN32API FindWindowA(LPCSTR lpszClass, LPCSTR lpszWindow)
833{
834 if(!lpszClass) {
835 SetLastError(ERROR_INVALID_PARAMETER);
836 return 0;
837 }
838 if(HIWORD(lpszClass)) {
839 dprintf(("USER32: FindWindow %s %s\n", lpszClass, lpszWindow));
840 }
841 else dprintf(("USER32: FindWindow %x %s\n", lpszClass, lpszWindow));
842
843 return Win32BaseWindow::FindWindowEx(OSLIB_HWND_DESKTOP, 0, (LPSTR)lpszClass, (LPSTR)lpszWindow);
844}
845//******************************************************************************
846//******************************************************************************
847HWND WIN32API FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow)
848{
849 if(!lpszClass) {
850 SetLastError(ERROR_INVALID_PARAMETER);
851 return 0;
852 }
853 if(HIWORD(lpszClass)) {
854 dprintf(("USER32: FindWindowExA (%x,%x) %s %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
855 }
856 else dprintf(("USER32: FindWindowExA (%x,%x)%x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
857
858 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
859}
860/*****************************************************************************
861 * Name : HWND WIN32API FindWindowExW
862 * Purpose : The FindWindowEx function retrieves the handle of a window whose
863 * class name and window name match the specified strings. The
864 * function searches child windows, beginning with the one following
865 * the given child window.
866 * Parameters: HWND hwndParent handle of parent window
867 * HWND hwndChildAfter handle of a child window
868 * LPCTSTR lpszClass address of class name
869 * LPCTSTR lpszWindow address of window name
870 * Variables :
871 * Result : If the function succeeds, the return value is the handle of the
872 * window that has the specified class and window names.
873 * If the function fails, the return value is NULL. To get extended
874 * error information, call GetLastError.
875 * Remark :
876 * Status : UNTESTED STUB
877 *
878 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
879 *****************************************************************************/
880
881HWND WIN32API FindWindowExW(HWND hwndParent,
882 HWND hwndChildAfter,
883 LPCWSTR lpszClass,
884 LPCWSTR lpszWindow)
885{
886 if(!lpszClass) {
887 SetLastError(ERROR_INVALID_PARAMETER);
888 return 0;
889 }
890 dprintf(("USER32: FindWindowExW (%x,%x) %x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
891
892 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
893}
894//******************************************************************************
895//******************************************************************************
896BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
897{
898 dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
899 return OSLibWinFlashWindow(Win32BaseWindow::Win32ToOS2Handle(hwnd), fFlash);
900}
901//******************************************************************************
902//******************************************************************************
903BOOL WIN32API MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
904 BOOL repaint )
905{
906 int flags = SWP_NOZORDER | SWP_NOACTIVATE;
907
908 if (!repaint) flags |= SWP_NOREDRAW;
909 dprintf(("MoveWindow: %04x %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint ));
910
911 return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
912}
913//******************************************************************************
914//******************************************************************************
915BOOL WIN32API ClientToScreen (HWND hwnd, PPOINT pt)
916{
917#ifdef DEBUG
918 WriteLog("USER32: ClientToScreen\n");
919#endif
920 Win32BaseWindow *wnd;
921 PRECT rcl;
922
923 if (!hwnd) {
924 SetLastError(ERROR_INVALID_PARAMETER);
925 return (FALSE);
926 }
927 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
928 if (!wnd) {
929 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
930 return (FALSE);
931 }
932
933 rcl = wnd->getClientRect();
934 pt->y = (rcl->bottom - rcl->top) - pt->y;
935 OSLibWinMapWindowPoints (wnd->getOS2WindowHandle(), OSLIB_HWND_DESKTOP, (OSLIBPOINT *)pt, 1);
936 pt->y = ScreenHeight - pt->y;
937 return (TRUE);
938}
939//******************************************************************************
940//******************************************************************************
941HDWP WIN32API BeginDeferWindowPos( int arg1)
942{
943#ifdef DEBUG
944 WriteLog("USER32: BeginDeferWindowPos\n");
945#endif
946 return O32_BeginDeferWindowPos(arg1);
947}
948//******************************************************************************
949//******************************************************************************
950HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND arg3, int arg4, int arg5, int arg6, int arg7, UINT arg8)
951{
952#ifdef DEBUG
953 WriteLog("USER32: DeferWindowPos\n");
954#endif
955 return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
956}
957//******************************************************************************
958//******************************************************************************
959HWND WIN32API ChildWindowFromPoint( HWND hwnd, POINT pt)
960{
961 dprintf(("USER32: ChildWindowFromPoint\n"));
962// return O32_ChildWindowFromPoint(arg1, arg2);
963 return ChildWindowFromPointEx(hwnd, pt, 0);
964}
965//******************************************************************************
966//******************************************************************************
967/*****************************************************************************
968 * Name : HWND WIN32API ChildWindowFromPointEx
969 * Purpose : The GetWindowRect function retrieves the dimensions of the
970 * bounding rectangle of the specified window. The dimensions are
971 * given in screen coordinates that are relative to the upper-left
972 * corner of the screen.
973 * Parameters:
974 * Variables :
975 * Result : If the function succeeds, the return value is the window handle.
976 * If the function fails, the return value is zero
977 * Remark :
978 * Status : FULLY IMPLEMENTED AND TESTED
979 *
980 * Author : Rene Pronk [Sun, 1999/08/08 23:30]
981 *****************************************************************************/
982
983HWND WIN32API ChildWindowFromPointEx (HWND hwndParent, POINT pt, UINT uFlags)
984{
985 RECT rect;
986 HWND hWnd;
987 POINT absolutePt;
988
989 dprintf(("ChildWindowFromPointEx(%08xh,%08xh,%08xh).\n",
990 hwndParent, pt, uFlags));
991
992 if (GetWindowRect (hwndParent, &rect) == 0) {
993 // oops, invalid handle
994 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
995 return NULL;
996 }
997
998 // absolutePt has its top in the upper-left corner of the screen
999 absolutePt = pt;
1000 ClientToScreen (hwndParent, &absolutePt);
1001
1002 // make rect the size of the parent window
1003 GetWindowRect (hwndParent, &rect);
1004 rect.right = rect.right - rect.left;
1005 rect.bottom = rect.bottom - rect.top;
1006 rect.left = 0;
1007 rect.top = 0;
1008
1009 if (PtInRect (&rect, pt) == 0) {
1010 // point is outside window
1011 return NULL;
1012 }
1013
1014 // get first child
1015 hWnd = GetWindow (hwndParent, GW_CHILD);
1016
1017 while (hWnd != NULL) {
1018
1019 // do I need to skip this window?
1020 if (((uFlags & CWP_SKIPINVISIBLE) &&
1021 (IsWindowVisible (hWnd) == FALSE)) ||
1022 ((uFlags & CWP_SKIPDISABLED) &&
1023 (IsWindowEnabled (hWnd) == FALSE)) ||
1024 ((uFlags & CWP_SKIPTRANSPARENT) &&
1025 (GetWindowLongA (hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT)))
1026
1027 {
1028 hWnd = GetWindow (hWnd, GW_HWNDNEXT);
1029 continue;
1030 }
1031
1032 // is the point in this window's rect?
1033 GetWindowRect (hWnd, &rect);
1034 if (PtInRect (&rect, absolutePt) == FALSE) {
1035 hWnd = GetWindow (hWnd, GW_HWNDNEXT);
1036 continue;
1037 }
1038
1039 dprintf(("ChildWindowFromPointEx returned %x", hWnd));
1040 // found it!
1041 return hWnd;
1042 }
1043
1044 // the point is in the parentwindow but the parentwindow has no child
1045 // at this coordinate
1046 dprintf(("ChildWindowFromPointEx returned parent %x", hwndParent));
1047 return hwndParent;
1048}
1049//******************************************************************************
1050//******************************************************************************
1051BOOL WIN32API CloseWindow(HWND hwnd)
1052{
1053 Win32BaseWindow *window;
1054
1055 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
1056 if(!window) {
1057 dprintf(("CloseWindow, window %x not found", hwnd));
1058 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1059 return 0;
1060 }
1061 dprintf(("CloseWindow %x\n", hwnd));
1062 return window->CloseWindow();
1063}
1064//******************************************************************************
1065//TODO: Does this return handles of hidden or disabled windows?
1066//******************************************************************************
1067HWND WIN32API WindowFromPoint( POINT point)
1068{
1069 HWND hwnd;
1070
1071 dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
1072 hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
1073 if(hwnd) {
1074 return Win32BaseWindow::OS2ToWin32Handle(hwnd);
1075 }
1076 return 0;
1077}
1078//******************************************************************************
1079//******************************************************************************
1080BOOL WIN32API IsWindowUnicode(HWND hwnd)
1081{
1082 Win32BaseWindow *window;
1083
1084 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
1085 if(!window) {
1086 dprintf(("IsWindowUnicode, window %x not found", hwnd));
1087 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1088 return 0;
1089 }
1090 return window->IsUnicode();
1091}
1092/*****************************************************************************
1093 * Name : WORD WIN32API CascadeWindows
1094 * Purpose : The CascadeWindows function cascades the specified windows or
1095 * the child windows of the specified parent window.
1096 * Parameters: HWND hwndParent handle of parent window
1097 * UINT wHow types of windows not to arrange
1098 * CONST RECT * lpRect rectangle to arrange windows in
1099 * UINT cKids number of windows to arrange
1100 * const HWND FAR * lpKids array of window handles
1101 * Variables :
1102 * Result : If the function succeeds, the return value is the number of windows arranged.
1103 * If the function fails, the return value is zero.
1104 * Remark :
1105 * Status : UNTESTED STUB
1106 *
1107 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1108 *****************************************************************************/
1109
1110WORD WIN32API CascadeWindows(HWND hwndParent,
1111 UINT wHow,
1112 CONST LPRECT lpRect,
1113 UINT cKids,
1114 const HWND *lpKids)
1115{
1116 dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
1117 hwndParent,
1118 wHow,
1119 lpRect,
1120 cKids,
1121 lpKids));
1122
1123 return (0);
1124}
1125/*****************************************************************************
1126 * Name : BOOL WIN32API SwitchToThisWindow
1127 * Purpose : Unknown
1128 * Parameters: Unknown
1129 * Variables :
1130 * Result :
1131 * Remark :
1132 * Status : UNTESTED UNKNOWN STUB
1133 *
1134 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
1135 *****************************************************************************/
1136
1137BOOL WIN32API SwitchToThisWindow(HWND hwnd,
1138 BOOL x2)
1139{
1140 dprintf(("USER32: SwitchToThisWindow(%08xh,%08xh) not implemented.\n",
1141 hwnd,
1142 x2));
1143
1144 return (FALSE); /* default */
1145}
1146//******************************************************************************
1147//******************************************************************************
1148BOOL WIN32API EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam)
1149{
1150 Win32BaseWindow *window;
1151 BOOL rc;
1152 ULONG henum;
1153 HWND hwndNext;
1154 ULONG tid;
1155 ULONG pid, curpid;
1156
1157 dprintf(("EnumThreadWindows\n"));
1158
1159 curpid = GetCurrentProcessId();
1160
1161 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
1162 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1163 {
1164 OSLibWinQueryWindowProcess(hwndNext, &pid, &tid);
1165 if(!(curpid == pid && dwThreadId == tid))
1166 continue;
1167
1168 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1169 if(window == NULL) {
1170 //OS/2 window or non-frame window, so skip it
1171 continue;
1172 }
1173 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE)
1174 break;
1175 }
1176 OSLibWinEndEnumWindows (henum);
1177 return TRUE;
1178}
1179//******************************************************************************
1180//******************************************************************************
1181BOOL WIN32API EnumChildWindows(HWND hwnd, WNDENUMPROC lpfn, LPARAM lParam)
1182{
1183 Win32BaseWindow *window, *parentwindow;
1184 BOOL rc = TRUE;
1185 ULONG henum;
1186 HWND hwndNext;
1187
1188 dprintf(("EnumChildWindows %x %x\n", hwnd, lParam));
1189
1190 parentwindow = Win32BaseWindow::GetWindowFromHandle(hwnd);
1191 if(!parentwindow) {
1192 dprintf(("EnumChildWindows, window %x not found", hwnd));
1193 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
1194 return FALSE;
1195 }
1196
1197 henum = OSLibWinBeginEnumWindows(OSLIB_HWND_DESKTOP);
1198 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1199 {
1200 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1201 if(window == NULL) {
1202 //OS/2 window or non-frame window, so skip it
1203 continue;
1204 }
1205 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE)
1206 {
1207 rc = FALSE;
1208 break;
1209 }
1210 }
1211 OSLibWinEndEnumWindows(henum);
1212 return rc;
1213}
1214//******************************************************************************
1215//******************************************************************************
1216BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
1217{
1218 Win32BaseWindow *window;
1219 BOOL rc;
1220 ULONG henum;
1221 HWND hwndNext, hwndParent = OSLIB_HWND_DESKTOP;
1222
1223 dprintf(("EnumThreadWindows\n"));
1224
1225 do {
1226 henum = OSLibWinBeginEnumWindows(hwndParent);
1227 while ((hwndNext = OSLibWinGetNextWindow(henum)) != 0)
1228 {
1229 window = Win32BaseWindow::GetWindowFromHandle(hwndNext);
1230 if(window == NULL) {
1231 //OS/2 window or non-frame window, so skip it
1232 continue;
1233 }
1234 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) {
1235 goto Abort;
1236 }
1237 }
1238 if(hwndParent == OSLIB_HWND_OBJECT)
1239 break;
1240 hwndParent = OSLIB_HWND_OBJECT;
1241 OSLibWinEndEnumWindows(henum);
1242 }
1243 while(TRUE);
1244
1245Abort:
1246 OSLibWinEndEnumWindows(henum);
1247 return TRUE;
1248}
1249//******************************************************************************
1250//******************************************************************************
1251#if 0
1252BOOL WIN32API GetUpdateRect( HWND hwnd, PRECT lpRect, BOOL bErase)
1253{
1254 dprintf(("GetUpdateRect %x %d\n", hwnd, bErase));
1255 if (!lpRect) return FALSE;
1256
1257 return OSLibWinQueryUpdateRect(Win32BaseWindow::Win32ToOS2Handle(hwnd), lpRect);
1258}
1259#endif
1260//******************************************************************************
1261//******************************************************************************
1262#if 0
1263BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase)
1264{
1265#ifdef DEBUG
1266 if(lpRect)
1267 WriteLog("USER32: InvalidateRect for window %X (%d,%d)(%d,%d) %d\n", hWnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase);
1268 else WriteLog("USER32: InvalidateRect for window %X NULL, %d\n", hWnd, bErase);
1269#endif
1270
1271 //CB: bErase no quite the same
1272 hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
1273 if (lpRect)
1274 {
1275 return OSLibWinInvalidateRect(hWnd, (PRECT)lpRect, bErase);
1276 }
1277 else return OSLibWinInvalidateRect(hWnd,NULL,bErase);
1278}
1279#endif
1280//******************************************************************************
1281//******************************************************************************
1282UINT WIN32API ArrangeIconicWindows( HWND arg1)
1283{
1284#ifdef DEBUG
1285 WriteLog("USER32: ArrangeIconicWindows\n");
1286#endif
1287 return O32_ArrangeIconicWindows(arg1);
1288}
1289//******************************************************************************
1290//restores iconized window to previous size/position
1291//******************************************************************************
1292BOOL WIN32API OpenIcon(HWND hwnd)
1293{
1294#ifdef DEBUG
1295 WriteLog("USER32: OpenIcon\n");
1296#endif
1297 if(!IsIconic(hwnd))
1298 return FALSE;
1299 ShowWindow(hwnd, SW_SHOWNORMAL);
1300 return TRUE;
1301}
1302//******************************************************************************
1303//******************************************************************************
1304BOOL WIN32API ShowOwnedPopups( HWND arg1, BOOL arg2)
1305{
1306 dprintf(("USER32: ShowOwnedPopups\n"));
1307 return O32_ShowOwnedPopups(arg1, arg2);
1308}
1309//******************************************************************************
1310//******************************************************************************
1311
Note: See TracBrowser for help on using the repository browser.