source: trunk/src/user32/oslibwin.cpp@ 1055

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

* empty log message *

File size: 23.6 KB
Line 
1/* $Id: oslibwin.cpp,v 1.8 1999-09-25 19:11:18 sandervl Exp $ */
2/*
3 * Window API wrappers for OS/2
4 *
5 *
6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Daniela Engert (dani@ngrt.de)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#define INCL_WIN
14#define INCL_PM
15#include <os2.h>
16#include <os2wrap.h>
17#include <stdlib.h>
18#include <string.h>
19
20#include <misc.h>
21#include "win32type.h"
22#include <winconst.h>
23#include "oslibwin.h"
24#include "oslibutil.h"
25#include "oslibmsg.h"
26#include "oslibgdi.h"
27#include "pmwindow.h"
28
29//******************************************************************************
30//******************************************************************************
31BOOL OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw)
32{
33 if(hwndParent == OSLIB_HWND_DESKTOP)
34 {
35 hwndParent = HWND_DESKTOP;
36 }
37
38 return (WinSetParent(hwnd, hwndParent, fRedraw) == 0);
39}
40//******************************************************************************
41//******************************************************************************
42HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
43 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
44{
45 HWND hwndClient;
46
47 dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName));
48
49 if(pszName && *pszName == 0) {
50 pszName = NULL;
51 }
52 if(hwndParent == OSLIB_HWND_DESKTOP) {
53 hwndParent = HWND_DESKTOP;
54 }
55 if(Owner == OSLIB_HWND_DESKTOP) {
56 Owner = HWND_DESKTOP;
57 }
58
59 if(dwFrameStyle) {
60 ULONG dwClientStyle;
61
62 dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP);
63 if(pszName)
64 dwFrameStyle |= FCF_TITLEBAR;
65
66 dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER | FCF_NOBYTEALIGN;
67 dwWinStyle &= ~WS_CLIPCHILDREN;
68
69 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
70 &dwFrameStyle, WIN32_STDCLASS,
71 "", dwClientStyle, 0, 0, &hwndClient);
72 if(*hwndFrame) {
73 if(pszName) {
74 WinSetWindowText(*hwndFrame, pszName);
75 }
76 return hwndClient;
77 }
78 dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
79 return 0;
80 }
81 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, 0, 0, 0, 0,
82 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
83 NULL);
84 *hwndFrame = hwndClient;
85 return hwndClient;
86}
87//******************************************************************************
88//******************************************************************************
89BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle)
90{
91 *OSWinStyle = 0;
92 *OSFrameStyle = 0;
93
94 /* Window styles */
95 if(dwStyle & WS_MINIMIZE_W)
96 *OSWinStyle |= WS_MINIMIZED;
97//Done explicitely in CreateWindowExA
98#if 0
99 if(dwStyle & WS_VISIBLE_W)
100 *OSWinStyle |= WS_VISIBLE;
101#endif
102 if(dwStyle & WS_DISABLED_W)
103 *OSWinStyle |= WS_DISABLED;
104 if(dwStyle & WS_CLIPSIBLINGS_W)
105 *OSWinStyle |= WS_CLIPSIBLINGS;
106 if(dwStyle & WS_CLIPCHILDREN_W)
107 *OSWinStyle |= WS_CLIPCHILDREN;
108 if(dwStyle & WS_MAXIMIZE_W)
109 *OSWinStyle |= WS_MAXIMIZED;
110 if(dwStyle & WS_GROUP_W)
111 *OSWinStyle |= WS_GROUP;
112 if(dwStyle & WS_TABSTOP_W)
113 *OSWinStyle |= WS_TABSTOP;
114
115 if (dwStyle & WS_CHILD_W)
116 {
117 if (dwExStyle & WS_EX_CLIENTEDGE_W ||
118 dwExStyle & WS_EX_STATICEDGE_W ||
119 dwExStyle & WS_EX_WINDOWEDGE_W)
120 *OSFrameStyle |= FCF_DLGBORDER;
121
122 if(dwStyle & WS_VSCROLL_W)
123 *OSFrameStyle |= FCF_VERTSCROLL;
124 if(dwStyle & WS_HSCROLL_W)
125 *OSFrameStyle |= FCF_HORZSCROLL;
126 } else
127 {
128 if(dwStyle & WS_CAPTION_W)
129 *OSFrameStyle |= FCF_TITLEBAR;
130 if(dwStyle & WS_DLGFRAME_W)
131 *OSFrameStyle |= FCF_DLGBORDER;
132 else
133 if(dwStyle & WS_BORDER_W)
134 *OSFrameStyle |= FCF_BORDER;
135
136 if(dwStyle & WS_VSCROLL_W)
137 *OSFrameStyle |= FCF_VERTSCROLL;
138 if(dwStyle & WS_HSCROLL_W)
139 *OSFrameStyle |= FCF_HORZSCROLL;
140 if(dwStyle & WS_SYSMENU_W)
141 *OSFrameStyle |= FCF_SYSMENU;
142 if(dwStyle & WS_THICKFRAME_W)
143 *OSFrameStyle |= FCF_SIZEBORDER; //??
144 if(dwStyle & WS_MINIMIZEBOX_W)
145 *OSFrameStyle |= FCF_MINBUTTON;
146 if(dwStyle & WS_MAXIMIZEBOX_W)
147 *OSFrameStyle |= FCF_MAXBUTTON;
148
149 if(dwExStyle & WS_EX_DLGMODALFRAME_W)
150 *OSFrameStyle |= FCF_DLGBORDER;
151 }
152
153 return TRUE;
154}
155//******************************************************************************
156//******************************************************************************
157BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value)
158{
159 return WinSetWindowULong(hwnd, offset, value);
160}
161//******************************************************************************
162//******************************************************************************
163ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset)
164{
165 return WinQueryWindowULong(hwnd, offset);
166}
167//******************************************************************************
168//******************************************************************************
169BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam)
170{
171 return WinPostMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam);
172}
173//******************************************************************************
174//******************************************************************************
175ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam)
176{
177 return (ULONG)WinSendMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam);
178}
179//******************************************************************************
180//******************************************************************************
181//******************************************************************************
182//******************************************************************************
183BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle)
184{
185 return WinAlarm(hwndDeskTop,flStyle);
186}
187//******************************************************************************
188//******************************************************************************
189APIRET OSLibDosBeep(ULONG freg,ULONG dur)
190{
191 return DosBeep(freg,dur);
192}
193//******************************************************************************
194//******************************************************************************
195HWND OSLibWinQueryFocus(HWND hwndDeskTop)
196{
197 return WinQueryFocus(hwndDeskTop);
198}
199//******************************************************************************
200//******************************************************************************
201HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id)
202{
203 return WinWindowFromID(hwndParent,id);
204}
205//******************************************************************************
206//******************************************************************************
207BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate)
208{
209 return WinFocusChange (hwndDeskTop, hwndNewFocus, activate ? FC_NOLOSEACTIVE : 0);
210}
211//******************************************************************************
212//******************************************************************************
213BOOL OSLibWinIsChild (HWND hwnd, HWND hwndOf)
214{
215 return WinIsChild (hwnd, hwndOf);
216}
217//******************************************************************************
218//******************************************************************************
219ULONG OSLibGetWindowHeight(HWND hwnd)
220{
221 RECTL rect;
222
223 return (WinQueryWindowRect(hwnd,&rect)) ? rect.yTop-rect.yBottom:0;
224}
225//******************************************************************************
226//******************************************************************************
227LONG OSLibWinQuerySysValue(HWND hwndDeskTop,LONG iSysValue)
228{
229 return WinQuerySysValue(hwndDeskTop,iSysValue);
230}
231//******************************************************************************
232//******************************************************************************
233ULONG OSLibWinQueryDlgItemText(HWND hwndDlg,ULONG idItem,LONG cchBufferMax,char* pchBuffer)
234{
235 return WinQueryDlgItemText(hwndDlg,idItem,cchBufferMax,pchBuffer);
236}
237//******************************************************************************
238//******************************************************************************
239BOOL OSLibWinSetDlgItemText(HWND hwndDlg,ULONG idItem,char* pszText)
240{
241 return WinSetDlgItemText(hwndDlg,idItem,pszText);
242}
243//******************************************************************************
244//******************************************************************************
245BOOL OSLibWinQueryPointerPos(HWND hwndDeskTop,PPOINT pptlPoint)
246{
247 return WinQueryPointerPos(hwndDeskTop,(PPOINTL)pptlPoint);
248}
249//******************************************************************************
250//******************************************************************************
251HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode)
252{
253 return WinQueryWindow(hwnd, lCode);
254}
255//******************************************************************************
256//******************************************************************************
257BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx,
258 LONG cy, ULONG fl)
259{
260 HWND hwndParent = hwndInsertBehind;
261 BOOL rc;
262
263 if(fl & SWP_MOVE) {
264 switch(hwndParent)
265 {
266 case HWNDOS_TOP:
267 case HWNDOS_BOTTOM:
268 hwndParent = HWND_DESKTOP;
269 break;
270 }
271 y = MapOS2ToWin32Y(hwndParent, cy, y);
272 }
273 rc = WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
274 dprintf(("WinSetWindowPos %x %x %d %d %d %d %x returned %d (%x)", hwnd, hwndInsertBehind, x, y, cx, cy, fl, rc, WinGetLastError(GetThreadHAB())));
275 return rc;
276}
277//******************************************************************************
278//******************************************************************************
279BOOL OSLibWinSetMultWindowPos(PSWP pswp, ULONG num)
280{
281 return WinSetMultWindowPos(GetThreadHAB(), pswp, num);
282}
283//******************************************************************************
284//******************************************************************************
285BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl)
286{
287 BOOL rc;
288
289 if(fl & SWP_SHOW) {
290 rc = WinShowWindow(hwnd, TRUE);
291 }
292 if(rc == 0)
293 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
294 rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl);
295 if(rc == 0)
296 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
297 return rc;
298}
299//******************************************************************************
300//******************************************************************************
301BOOL OSLibWinDestroyWindow(HWND hwnd)
302{
303 return WinDestroyWindow(hwnd);
304}
305//******************************************************************************
306//******************************************************************************
307BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo)
308{
309 BOOL rc;
310 RECTLOS2 rectl;
311
312 rc = WinQueryWindowRect(hwnd, (PRECTL)&rectl);
313 if(rc) {
314 if(RelativeTo == RELATIVE_TO_SCREEN) {
315 MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect);
316 }
317 else MapOS2ToWin32Rectl(&rectl, pRect);
318 }
319 else memset(pRect, 0, sizeof(RECT));
320 return rc;
321}
322//******************************************************************************
323//******************************************************************************
324BOOL OSLibWinIsIconic(HWND hwnd)
325{
326 SWP swp;
327 BOOL rc;
328
329 rc = WinQueryWindowPos(hwnd, &swp);
330 if(rc == FALSE) {
331 dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));
332 return FALSE;
333 }
334
335 if(swp.fl & SWP_MINIMIZE)
336 return TRUE;
337 else return FALSE;
338}
339//******************************************************************************
340//******************************************************************************
341BOOL OSLibWinSetActiveWindow(HWND hwnd)
342{
343 return WinSetActiveWindow(HWND_DESKTOP, hwnd);
344}
345//******************************************************************************
346//******************************************************************************
347BOOL OSLibWinSetFocus(HWND hwnd)
348{
349 return WinSetFocus(HWND_DESKTOP, hwnd);
350}
351//******************************************************************************
352//******************************************************************************
353BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable)
354{
355 return WinEnableWindow(hwnd, fEnable);
356}
357//******************************************************************************
358//******************************************************************************
359BOOL OSLibWinIsWindowEnabled(HWND hwnd)
360{
361 return WinIsWindowEnabled(hwnd);
362}
363//******************************************************************************
364//******************************************************************************
365BOOL OSLibWinIsWindowVisible(HWND hwnd)
366{
367 return WinIsWindowVisible(hwnd);
368}
369//******************************************************************************
370//******************************************************************************
371BOOL OSLibWinQueryActiveWindow()
372{
373 return WinQueryActiveWindow(HWND_DESKTOP);
374}
375//******************************************************************************
376//******************************************************************************
377LONG OSLibWinQueryWindowTextLength(HWND hwnd)
378{
379 return WinQueryWindowTextLength(hwnd);
380}
381//******************************************************************************
382//******************************************************************************
383LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz)
384{
385 return WinQueryWindowText(hwnd, length, lpsz);
386}
387//******************************************************************************
388//******************************************************************************
389BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz)
390{
391 return WinSetWindowText(hwnd, lpsz);
392}
393//******************************************************************************
394//******************************************************************************
395BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash)
396{
397 return WinFlashWindow(hwnd, fFlash);
398}
399//******************************************************************************
400//******************************************************************************
401HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint)
402{
403 return WinWindowFromPoint((hwnd == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP : hwnd, (PPOINTL)ppoint, TRUE);
404}
405//******************************************************************************
406//******************************************************************************
407BOOL OSLibWinMinimizeWindow(HWND hwnd)
408{
409 return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_MINIMIZE);
410}
411//******************************************************************************
412//******************************************************************************
413BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl)
414{
415 pointl->x = 0;
416 pointl->y = 0;
417 return (BOOL) WinSendMsg(hwnd, WM_QUERYBORDERSIZE, MPFROMP( &pointl), 0);
418}
419//******************************************************************************
420//******************************************************************************
421BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon)
422{
423 return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
424}
425//******************************************************************************
426//******************************************************************************
427BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp)
428{
429 return WinQueryWindowPos(hwnd, pswp);
430}
431//******************************************************************************
432//******************************************************************************
433void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
434{
435 HWND hWindow = pswp->hwnd;
436 HWND hWndInsertAfter = pswp->hwndInsertBehind;
437 long x = pswp->x;
438 long y = pswp->y;
439 long cx = pswp->cx;
440 long cy = pswp->cy;
441 UINT fuFlags = (UINT)pswp->fl;
442 ULONG parentHeight;
443
444 HWND hWinAfter;
445 ULONG flags = 0;
446
447 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
448
449 if (hWndInsertAfter == HWND_TOP)
450 hWinAfter = HWND_TOP_W;
451 else if (hWndInsertAfter == HWND_BOTTOM)
452 hWinAfter = HWND_BOTTOM_W;
453 else
454 hWinAfter = (HWND) hWndInsertAfter;
455
456 //***********************************
457 // convert PM flags to Windows flags
458 //***********************************
459 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W;
460 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W;
461 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W;
462 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W;
463 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W;
464 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W;
465 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W;
466
467 if (fuFlags & (SWP_MOVE | SWP_SIZE))
468 {
469 if (hParent == NULLHANDLE)
470 {
471 ULONG Offset;
472 POINTL pt = {0, 0};
473
474 Offset = OSLibGetWindowHeight(hFrame) - cy;
475 parentHeight = ScreenHeight;
476
477 cx += 2 * x;
478 cy += Offset;
479 WinMapWindowPoints (hFrame, HWND_DESKTOP, &pt, 1);
480 x = pt.x;
481 y = pt.y;
482
483 pswpOld->cx += 2 * pswpOld->x;
484 pswpOld->cy += Offset;
485 pswpOld->x = pt.x;
486 pswpOld->y = pt.y;
487 }
488 else
489 {
490 parentHeight = OSLibGetWindowHeight(hParent);
491 }
492
493 if (fuFlags & SWP_SIZE)
494 {
495 if (cy != pswpOld->cy)
496 {
497 flags &= ~SWP_NOMOVE_W;
498 }
499 }
500 else
501 {
502 cx = pswpOld->cx;
503 cy = pswpOld->cy;
504 }
505
506 if ((fuFlags & SWP_MOVE) == 0)
507 {
508 x = pswpOld->x;
509 y = pswpOld->y;
510 }
511
512 y = parentHeight - y - cy;
513 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy;
514
515 if ((pswpOld->x == x) && (oldY == y))
516 flags |= SWP_NOMOVE_W;
517
518 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
519 flags |= SWP_NOSIZE_W;
520 }
521
522 if (hParent == NULLHANDLE)
523 {
524 pswpOld->x = x + pswp->x;
525 pswpOld->y = y + cy - pswp->y - pswp->cy;
526 }
527 else {
528 pswpOld->x = pswp->x;
529 pswpOld->y = parentHeight - pswp->y - cy;
530 }
531 pswpOld->cx = pswp->cx;
532 pswpOld->cy = pswp->cy;
533
534dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)",
535 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
536
537 pwpos->flags = (UINT)flags;
538 pwpos->cy = (int)cy;
539 pwpos->cx = (int)cx;
540 pwpos->x = (int)x;
541 pwpos->y = (int)y;
542 pwpos->hwndInsertAfter = hWinAfter;
543 pwpos->hwnd = hWindow;
544}
545//******************************************************************************
546//******************************************************************************
547void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
548{
549 HWND hWnd = pwpos->hwnd;
550 HWND hWndInsertAfter = pwpos->hwndInsertAfter;
551 long x = pwpos->x;
552 long y = pwpos->y;
553 long cx = pwpos->cx;
554 long cy = pwpos->cy;
555 UINT fuFlags = pwpos->flags;
556 ULONG parentHeight;
557
558 HWND hWinAfter;
559 ULONG flags = 0;
560 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP;
561
562 if (hWndInsertAfter == HWND_TOPMOST_W)
563// hWinAfter = HWND_TOPMOST;
564 hWinAfter = HWND_TOP;
565 else if (hWndInsertAfter == HWND_NOTOPMOST_W)
566// hWinAfter = HWND_NOTOPMOST;
567 hWinAfter = HWND_TOP;
568 else if (hWndInsertAfter == HWND_TOP_W)
569 hWinAfter = HWND_TOP;
570 else if (hWndInsertAfter == HWND_BOTTOM_W)
571 hWinAfter = HWND_BOTTOM;
572 else
573 hWinAfter = (HWND) hWndInsertAfter;
574
575 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE;
576 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE;
577 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER;
578 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW;
579 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE;
580 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW;
581 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE;
582
583 if (flags & (SWP_MOVE | SWP_SIZE))
584 {
585 if (hParent == NULLHANDLE)
586 parentHeight = ScreenHeight;
587 else
588 parentHeight = OSLibGetWindowHeight(hParent);
589
590 if ((flags & SWP_MOVE) == 0)
591 {
592 x = pswpOld->x;
593 y = pswpOld->y;
594
595 if (!((y == 0) && (pswpOld->cy == 0)))
596 {
597 y = parentHeight - y - pswpOld->cy;
598 }
599 }
600
601 if (flags & SWP_SIZE)
602 {
603 if (cy != pswpOld->cy)
604 flags |= SWP_MOVE;
605 }
606 else
607 {
608 cx = pswpOld->cx;
609 cy = pswpOld->cy;
610 }
611
612 y = parentHeight - y - cy;
613
614 if ((pswpOld->x == x) && (pswpOld->y == y))
615 flags &= ~SWP_MOVE;
616
617 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
618 flags &= ~SWP_SIZE;
619 }
620
621 pswp->fl = flags;
622 pswp->cy = cy;
623 pswp->cx = cx;
624 pswp->x = x;
625 pswp->y = y;
626 pswp->hwndInsertBehind = hWinAfter;
627 pswp->hwnd = hWindow;
628 pswp->ulReserved1 = 0;
629 pswp->ulReserved2 = 0;
630}
631//******************************************************************************
632//******************************************************************************
633HWND OSLibWinBeginEnumWindows(HWND hwnd)
634{
635 if(hwnd == OSLIB_HWND_DESKTOP) hwnd = HWND_DESKTOP;
636 else
637 if(hwnd == OSLIB_HWND_OBJECT) hwnd = HWND_OBJECT;
638
639 return WinBeginEnumWindows(hwnd);
640}
641//******************************************************************************
642//******************************************************************************
643HWND OSLibWinGetNextWindow(HWND hwndEnum)
644{
645 return WinGetNextWindow(hwndEnum);
646}
647//******************************************************************************
648//******************************************************************************
649HWND OSLibWinQueryClientWindow(HWND hwndFrame)
650{
651 HWND hwndClient = 0;
652
653 if(((ULONG)WinSendMsg(hwndFrame, WM_QUERYFRAMEINFO, NULL, NULL)) & FI_FRAME)
654 hwndClient = WinWindowFromID(hwndFrame, FID_CLIENT);
655
656 return hwndClient;
657}
658//******************************************************************************
659//******************************************************************************
660BOOL OSLibWinEndEnumWindows(HWND hwndEnum)
661{
662 return WinEndEnumWindows(hwndEnum);
663}
664//******************************************************************************
665//******************************************************************************
666BOOL OSLibWinQueryWindowProcess(HWND hwnd, ULONG *pid, ULONG *tid)
667{
668 return WinQueryWindowProcess(hwnd, pid, tid);
669}
670//******************************************************************************
671//******************************************************************************
672BOOL OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num)
673{
674 return WinMapWindowPoints (hwndFrom, hwndTo, (PPOINTL)pptl, num);
675}
676//******************************************************************************
677//******************************************************************************
Note: See TracBrowser for help on using the repository browser.