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

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

Activate + group box fixes + cleanup changes

File size: 41.3 KB
Line 
1/* $Id: oslibwin.cpp,v 1.41 1999-11-01 19:11:40 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#define HAS_3DFRAME(exStyle) \
30 ((exStyle & WS_EX_CLIENTEDGE_W) || (exStyle & WS_EX_STATICEDGE_W) || (exStyle & WS_EX_WINDOWEDGE_W))
31
32//******************************************************************************
33//******************************************************************************
34BOOL OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw)
35{
36 if(hwndParent == OSLIB_HWND_DESKTOP)
37 {
38 hwndParent = HWND_DESKTOP;
39 }
40
41 return (WinSetParent(hwnd, hwndParent, fRedraw) == 0);
42}
43//******************************************************************************
44//******************************************************************************
45BOOL OSLibWinSetOwner(HWND hwnd, HWND hwndOwner)
46{
47 return WinSetOwner(hwnd, hwndOwner);
48}
49//******************************************************************************
50//******************************************************************************
51HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
52 char *pszName, HWND Owner, ULONG fBottom, HWND *hwndFrame,
53 ULONG id)
54{
55 HWND hwndClient;
56
57 dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName));
58
59 if(pszName && *pszName == 0) {
60 pszName = NULL;
61 }
62 if(hwndParent == OSLIB_HWND_DESKTOP) {
63 hwndParent = HWND_DESKTOP;
64 }
65 if(Owner == OSLIB_HWND_DESKTOP) {
66 Owner = HWND_DESKTOP;
67 }
68
69 ULONG dwClientStyle;
70
71 BOOL TopLevel = hwndParent == HWND_DESKTOP;
72 FRAMECDATA FCData = {sizeof (FRAMECDATA), 0, 0, 0};
73
74 dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPSIBLINGS);
75
76 dwFrameStyle |= FCF_NOBYTEALIGN;
77 if (hwndParent == HWND_DESKTOP && dwFrameStyle & FCF_TITLEBAR) {
78 dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER;
79 }
80
81 dwWinStyle &= ~WS_CLIPCHILDREN;
82 FCData.flCreateFlags = dwFrameStyle;
83
84 *hwndFrame = WinCreateWindow (hwndParent,
85 TopLevel ? WC_FRAME : WIN32_INNERFRAME,
86 pszName, dwWinStyle, 0, 0, 50, 30,
87 hwndParent, HWND_TOP,
88 id, &FCData, NULL);
89 if (*hwndFrame) {
90 hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS,
91 NULL, dwClientStyle, 0, 0, 0, 0,
92 *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL);
93 if (hwndClient != NULLHANDLE)
94 WinSendMsg (*hwndFrame, WM_UPDATEFRAME, 0, 0);
95
96 return hwndClient;
97 }
98 dprintf(("OSLibWinCreateWindow: (FRAME) WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
99 return 0;
100}
101//******************************************************************************
102//******************************************************************************
103BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight)
104{
105 *OSWinStyle = 0;
106 *OSFrameStyle = 0;
107 *borderWidth = 0;
108 *borderHeight = 0;
109
110 /* Window styles */
111 if(dwStyle & WS_MINIMIZE_W)
112 *OSWinStyle |= WS_MINIMIZED;
113//Done explicitely in CreateWindowExA
114#if 1
115 if(dwStyle & WS_VISIBLE_W)
116 *OSWinStyle |= WS_VISIBLE;
117#endif
118 if(dwStyle & WS_DISABLED_W)
119 *OSWinStyle |= WS_DISABLED;
120 if(dwStyle & WS_CLIPSIBLINGS_W)
121 *OSWinStyle |= WS_CLIPSIBLINGS;
122 if(dwStyle & WS_CLIPCHILDREN_W)
123 *OSWinStyle |= WS_CLIPCHILDREN;
124 if(dwStyle & WS_MAXIMIZE_W)
125 *OSWinStyle |= WS_MAXIMIZED;
126 if(dwStyle & WS_GROUP_W)
127 *OSWinStyle |= WS_GROUP;
128 if(dwStyle & WS_TABSTOP_W)
129 *OSWinStyle |= WS_TABSTOP;
130
131 if(dwStyle & WS_CHILD_W && !((dwStyle & WS_CAPTION_W) == WS_CAPTION_W))
132 {
133//SvL: Causes crash in VPBuddy if enabled -> find bug
134#if 0
135 if (!HAS_3DFRAME(*dwExStyle) && (dwStyle & (WS_DLGFRAME_W | WS_THICKFRAME_W))) *dwExStyle |= WS_EX_DLGMODALFRAME_W;
136#endif
137
138 if (*dwExStyle & WS_EX_CLIENTEDGE_W)
139 {
140 *OSFrameStyle |= FCF_SIZEBORDER;
141 *borderHeight = *borderWidth = 2;
142 }
143 else
144 if (*dwExStyle & WS_EX_DLGMODALFRAME_W)
145 {
146 *OSFrameStyle |= FCF_SIZEBORDER;
147 *borderHeight = *borderWidth = 3;
148 }
149 else
150 if (*dwExStyle & WS_EX_STATICEDGE_W)
151 {
152 *OSFrameStyle |= FCF_SIZEBORDER;
153 *borderHeight = *borderWidth = 2;
154 }
155 else
156 if(dwStyle & WS_BORDER_W)
157 {
158 *OSFrameStyle |= FCF_BORDER;
159 *borderHeight = *borderWidth = 1;
160 }
161 else if (*dwExStyle & WS_EX_WINDOWEDGE_W); //no border
162
163 if(dwStyle & WS_VSCROLL_W)
164 *OSFrameStyle |= FCF_VERTSCROLL;
165 if(dwStyle & WS_HSCROLL_W)
166 *OSFrameStyle |= FCF_HORZSCROLL;
167 }
168 else
169 {
170 if((dwStyle & WS_CAPTION_W) == WS_DLGFRAME_W)
171 *OSFrameStyle |= FCF_DLGBORDER;
172 else
173 {
174 if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W)
175 *OSFrameStyle |= (FCF_TITLEBAR | FCF_BORDER);
176 else
177 if(dwStyle & WS_BORDER_W)
178 *OSFrameStyle |= FCF_BORDER;
179 }
180
181 if(dwStyle & WS_VSCROLL_W)
182 *OSFrameStyle |= FCF_VERTSCROLL;
183 if(dwStyle & WS_HSCROLL_W)
184 *OSFrameStyle |= FCF_HORZSCROLL;
185
186 if(dwStyle & WS_SYSMENU_W)
187 *OSFrameStyle |= FCF_SYSMENU;
188 if(dwStyle & WS_THICKFRAME_W)
189 *OSFrameStyle |= FCF_SIZEBORDER; //??
190 if(dwStyle & WS_MINIMIZEBOX_W)
191 *OSFrameStyle |= FCF_MINBUTTON;
192 if(dwStyle & WS_MAXIMIZEBOX_W)
193 *OSFrameStyle |= FCF_MAXBUTTON;
194
195 if(*dwExStyle & WS_EX_DLGMODALFRAME_W)
196 *OSFrameStyle |= FCF_DLGBORDER;
197 }
198
199 //Clear certain frame bits when the window doesn't have a titlebar
200 if(!(*OSFrameStyle & FCF_TITLEBAR)) {
201 *OSFrameStyle &= ~(FCF_MINBUTTON|FCF_MAXBUTTON|FCF_SYSMENU);
202 }
203 return TRUE;
204}
205//******************************************************************************
206//******************************************************************************
207BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value)
208{
209 if(offset == OSLIB_QWL_USER)
210 offset = QWL_USER;
211
212 return WinSetWindowULong(hwnd, offset, value);
213}
214//******************************************************************************
215//******************************************************************************
216ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset)
217{
218 if(offset == OSLIB_QWL_USER)
219 offset = QWL_USER;
220
221 return WinQueryWindowULong(hwnd, offset);
222}
223//******************************************************************************
224//******************************************************************************
225BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam)
226{
227 return WinPostMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam);
228}
229//******************************************************************************
230//******************************************************************************
231ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam)
232{
233 return (ULONG)WinSendMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam);
234}
235//******************************************************************************
236//******************************************************************************
237//******************************************************************************
238//******************************************************************************
239BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle)
240{
241 return WinAlarm(hwndDeskTop,flStyle);
242}
243//******************************************************************************
244//******************************************************************************
245APIRET OSLibDosBeep(ULONG freg,ULONG dur)
246{
247 return DosBeep(freg,dur);
248}
249//******************************************************************************
250//******************************************************************************
251HWND OSLibWinQueryFocus(HWND hwndDeskTop)
252{
253 return WinQueryFocus(hwndDeskTop);
254}
255//******************************************************************************
256//******************************************************************************
257HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id)
258{
259 return WinWindowFromID(hwndParent,id);
260}
261//******************************************************************************
262//******************************************************************************
263BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate)
264{
265 return WinFocusChange (hwndDeskTop, hwndNewFocus, activate ? FC_NOLOSEACTIVE : 0);
266}
267//******************************************************************************
268//******************************************************************************
269BOOL OSLibWinIsChild (HWND hwnd, HWND hwndOf)
270{
271 return WinIsChild (hwnd, hwndOf);
272}
273//******************************************************************************
274//******************************************************************************
275ULONG OSLibGetWindowHeight(HWND hwnd)
276{
277 RECTL rect;
278
279 return (WinQueryWindowRect(hwnd,&rect)) ? rect.yTop-rect.yBottom:0;
280}
281//******************************************************************************
282//******************************************************************************
283LONG OSLibWinQuerySysValue(HWND hwndDeskTop,LONG iSysValue)
284{
285 return WinQuerySysValue(hwndDeskTop,iSysValue);
286}
287//******************************************************************************
288//******************************************************************************
289ULONG OSLibWinQueryDlgItemText(HWND hwndDlg,ULONG idItem,LONG cchBufferMax,char* pchBuffer)
290{
291 return WinQueryDlgItemText(hwndDlg,idItem,cchBufferMax,pchBuffer);
292}
293//******************************************************************************
294//******************************************************************************
295BOOL OSLibWinSetDlgItemText(HWND hwndDlg,ULONG idItem,char* pszText)
296{
297 return WinSetDlgItemText(hwndDlg,idItem,pszText);
298}
299//******************************************************************************
300//******************************************************************************
301BOOL OSLibWinQueryPointerPos(HWND hwndDeskTop,PPOINT pptlPoint)
302{
303 return WinQueryPointerPos(hwndDeskTop,(PPOINTL)pptlPoint);
304}
305//******************************************************************************
306//******************************************************************************
307HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode)
308{
309 return WinQueryWindow(hwnd, lCode);
310}
311//******************************************************************************
312//******************************************************************************
313BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx,
314 LONG cy, ULONG fl)
315{
316 HWND hwndParent = hwndInsertBehind;
317 BOOL rc;
318
319 if(fl & SWP_MOVE) {
320 switch(hwndParent)
321 {
322 case HWNDOS_TOP:
323 case HWNDOS_BOTTOM:
324 hwndParent = HWND_DESKTOP;
325 break;
326 }
327 y = MapOS2ToWin32Y(hwndParent, cy, y);
328 }
329 rc = WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
330 dprintf(("WinSetWindowPos %x %x %d %d %d %d %x returned %d (%x)", hwnd, hwndInsertBehind, x, y, cx, cy, fl, rc, WinGetLastError(GetThreadHAB())));
331 return rc;
332}
333//******************************************************************************
334//******************************************************************************
335BOOL OSLibWinSetMultWindowPos(PSWP pswp, ULONG num)
336{
337 return WinSetMultWindowPos(GetThreadHAB(), pswp, num);
338}
339//******************************************************************************
340//******************************************************************************
341BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl)
342{
343 BOOL rc = 1;
344
345 if(fl & SWP_SHOW) {
346 rc = WinShowWindow(hwnd, TRUE);
347 }
348 if(rc == 0)
349 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
350 rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);
351 if(rc == 0)
352 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
353 return rc;
354}
355//******************************************************************************
356//******************************************************************************
357BOOL OSLibWinDestroyWindow(HWND hwnd)
358{
359 return WinDestroyWindow(hwnd);
360}
361//******************************************************************************
362//******************************************************************************
363BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo)
364{
365 BOOL rc;
366 RECTLOS2 rectl;
367
368 rc = WinQueryWindowRect(hwnd, (PRECTL)&rectl);
369 if(rc) {
370 if(RelativeTo == RELATIVE_TO_SCREEN) {
371 MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect);
372 }
373 else MapOS2ToWin32Rectl(&rectl, pRect);
374 }
375 else memset(pRect, 0, sizeof(RECT));
376 return rc;
377}
378//******************************************************************************
379//******************************************************************************
380BOOL OSLibWinIsIconic(HWND hwnd)
381{
382 SWP swp;
383 BOOL rc;
384
385 rc = WinQueryWindowPos(hwnd, &swp);
386 if(rc == FALSE) {
387 dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));
388 return FALSE;
389 }
390
391 if(swp.fl & SWP_MINIMIZE)
392 return TRUE;
393 else return FALSE;
394}
395//******************************************************************************
396//******************************************************************************
397BOOL OSLibWinSetActiveWindow(HWND hwnd)
398{
399 return WinSetActiveWindow(HWND_DESKTOP, hwnd);
400}
401//******************************************************************************
402//******************************************************************************
403BOOL OSLibWinSetFocus(HWND hwnd)
404{
405 return WinSetFocus(HWND_DESKTOP, hwnd);
406}
407//******************************************************************************
408//******************************************************************************
409BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable)
410{
411 return WinEnableWindow(hwnd, fEnable);
412}
413//******************************************************************************
414//******************************************************************************
415BOOL OSLibWinIsWindowEnabled(HWND hwnd)
416{
417 return WinIsWindowEnabled(hwnd);
418}
419//******************************************************************************
420//******************************************************************************
421BOOL OSLibWinIsWindowVisible(HWND hwnd)
422{
423 return WinIsWindowVisible(hwnd);
424}
425//******************************************************************************
426//******************************************************************************
427BOOL OSLibWinQueryActiveWindow()
428{
429 return WinQueryActiveWindow(HWND_DESKTOP);
430}
431//******************************************************************************
432//******************************************************************************
433LONG OSLibWinQueryWindowTextLength(HWND hwnd)
434{
435 return WinQueryWindowTextLength(hwnd);
436}
437//******************************************************************************
438//******************************************************************************
439LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz)
440{
441 return WinQueryWindowText(hwnd, length, lpsz);
442}
443//******************************************************************************
444//******************************************************************************
445BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz)
446{
447 return WinSetWindowText(hwnd, lpsz);
448}
449//******************************************************************************
450//******************************************************************************
451BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash)
452{
453 return WinFlashWindow(hwnd, fFlash);
454}
455//******************************************************************************
456//******************************************************************************
457HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint)
458{
459 return WinWindowFromPoint((hwnd == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP : hwnd, (PPOINTL)ppoint, TRUE);
460}
461//******************************************************************************
462//******************************************************************************
463BOOL OSLibWinMinimizeWindow(HWND hwnd)
464{
465 return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_MINIMIZE);
466}
467//******************************************************************************
468//******************************************************************************
469BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl)
470{
471 pointl->x = 0;
472 pointl->y = 0;
473 return (BOOL) WinSendMsg(hwnd, WM_QUERYBORDERSIZE, MPFROMP( &pointl), 0);
474}
475//******************************************************************************
476//******************************************************************************
477BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon)
478{
479 return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
480}
481//******************************************************************************
482//******************************************************************************
483BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp)
484{
485 return WinQueryWindowPos(hwnd, pswp);
486}
487//******************************************************************************
488//******************************************************************************
489void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
490{
491 HWND hWindow = pswp->hwnd;
492 HWND hWndInsertAfter = pswp->hwndInsertBehind;
493 long x = pswp->x;
494 long y = pswp->y;
495 long cx = pswp->cx;
496 long cy = pswp->cy;
497 UINT fuFlags = (UINT)pswp->fl;
498 ULONG parentHeight;
499
500 HWND hWinAfter;
501 ULONG flags = 0;
502 SWP swpFrame, swpClient;
503 POINTL point;
504
505 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
506
507 if (hWndInsertAfter == HWND_TOP)
508 hWinAfter = HWND_TOP_W;
509 else if (hWndInsertAfter == HWND_BOTTOM)
510 hWinAfter = HWND_BOTTOM_W;
511 else
512 hWinAfter = (HWND) hWndInsertAfter;
513
514 //***********************************
515 // convert PM flags to Windows flags
516 //***********************************
517 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W;
518 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W;
519 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W;
520 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W;
521 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W;
522 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W;
523 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W;
524 if ( fuFlags & SWP_NOADJUST) flags |= SWP_NOSENDCHANGING_W;
525
526 WinQueryWindowPos(hFrame, &swpFrame);
527
528 if(fuFlags & (SWP_MOVE | SWP_SIZE))
529 {
530 point.x = swpFrame.x;
531 point.y = swpFrame.y;
532 if(hParent)
533 {
534 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
535 }
536 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy;
537
538 cy = swpFrame.cy;
539 cx = swpFrame.cx;
540 x = point.x;
541 y = point.y;
542
543 if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
544 flags |= SWP_NOMOVE_W;
545
546 if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
547 flags |= SWP_NOSIZE_W;
548
549 if (fuFlags & SWP_SIZE)
550 {
551 if (pswp->cy != pswpOld->cy)
552 {
553 flags &= ~SWP_NOMOVE_W;
554 }
555 }
556 }
557
558 pswpOld->x = pswp->x;
559 pswpOld->y = swpFrame.cy - pswp->y - pswp->cy;
560 pswpOld->cx = pswp->cx;
561 pswpOld->cy = pswp->cy;
562
563 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)",
564 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
565
566 pwpos->flags = (UINT)flags;
567 pwpos->cy = cy;
568 pwpos->cx = cx;
569 pwpos->x = x;
570 pwpos->y = y;
571 pwpos->hwndInsertAfter = hWinAfter;
572 pwpos->hwnd = hWindow;
573}
574//******************************************************************************
575//******************************************************************************
576void OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
577{
578 HWND hWindow = pswp->hwnd;
579 HWND hWndInsertAfter = pswp->hwndInsertBehind;
580 long x = pswp->x;
581 long y = pswp->y;
582 long cx = pswp->cx;
583 long cy = pswp->cy;
584 UINT fuFlags = (UINT)pswp->fl;
585 ULONG parentHeight;
586
587 HWND hWinAfter;
588 ULONG flags = 0;
589 SWP swpClient;
590 POINTL point;
591
592 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
593
594 if (hWndInsertAfter == HWND_TOP)
595 hWinAfter = HWND_TOP_W;
596 else if (hWndInsertAfter == HWND_BOTTOM)
597 hWinAfter = HWND_BOTTOM_W;
598 else
599 hWinAfter = (HWND) hWndInsertAfter;
600
601 //***********************************
602 // convert PM flags to Windows flags
603 //***********************************
604 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W;
605 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W;
606 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W;
607 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W;
608 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W;
609 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W;
610 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W;
611 if ( fuFlags & SWP_NOADJUST) flags |= SWP_NOSENDCHANGING_W;
612
613 WinQueryWindowPos(WinWindowFromID(hFrame, FID_CLIENT), &swpClient);
614
615 if(fuFlags & (SWP_MOVE | SWP_SIZE))
616 {
617 point.x = x;
618 point.y = y;
619 if(hParent)
620 {
621 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
622 }
623 point.y = OSLibQueryScreenHeight() - point.y - cy;
624
625 x = point.x;
626 y = point.y;
627
628 if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
629 flags |= SWP_NOMOVE_W;
630
631 if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
632 flags |= SWP_NOSIZE_W;
633
634 if (fuFlags & SWP_SIZE)
635 {
636 if (pswp->cy != pswpOld->cy)
637 {
638 flags &= ~SWP_NOMOVE_W;
639 }
640 }
641 }
642
643 pswpOld->x = swpClient.x;
644 pswpOld->y = pswp->cy - swpClient.y - swpClient.cy;
645 pswpOld->cx = swpClient.cx;
646 pswpOld->cy = swpClient.cy;
647
648 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)",
649 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
650
651 pwpos->flags = (UINT)flags;
652 pwpos->cy = cy;
653 pwpos->cx = cx;
654 pwpos->x = x;
655 pwpos->y = y;
656 pwpos->hwndInsertAfter = hWinAfter;
657 pwpos->hwnd = hWindow;
658}
659//******************************************************************************
660//******************************************************************************
661void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
662{
663 BOOL fCvt = FALSE;
664
665 HWND hWnd = pwpos->hwnd;
666 HWND hWndInsertAfter = pwpos->hwndInsertAfter;
667 long x = pwpos->x;
668 long y = pwpos->y;
669 long cx = pwpos->cx;
670 long cy = pwpos->cy;
671 UINT fuFlags = pwpos->flags;
672 ULONG parentHeight;
673
674 HWND hWinAfter;
675 ULONG flags = 0;
676 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP;
677
678 if (hWndInsertAfter == HWND_TOPMOST_W)
679// hWinAfter = HWND_TOPMOST;
680 hWinAfter = HWND_TOP;
681 else if (hWndInsertAfter == HWND_NOTOPMOST_W)
682// hWinAfter = HWND_NOTOPMOST;
683 hWinAfter = HWND_TOP;
684 else if (hWndInsertAfter == HWND_TOP_W)
685 hWinAfter = HWND_TOP;
686 else if (hWndInsertAfter == HWND_BOTTOM_W)
687 hWinAfter = HWND_BOTTOM;
688 else
689 hWinAfter = (HWND) hWndInsertAfter;
690
691 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE;
692 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE;
693 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER;
694 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW;
695 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE;
696 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW;
697 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE;
698 if ( fuFlags & SWP_NOSENDCHANGING_W) flags |= SWP_NOADJUST;
699
700 if (flags & (SWP_MOVE | SWP_SIZE))
701 {
702 if (hParent == NULLHANDLE)
703 parentHeight = ScreenHeight;
704 else
705 parentHeight = OSLibGetWindowHeight(hParent);
706
707 if ((flags & SWP_MOVE) == 0)
708 {
709 x = pswpOld->x;
710 y = pswpOld->y;
711
712 if (!((y == 0) && (pswpOld->cy == 0)))
713 {
714 y = parentHeight - y - pswpOld->cy;
715 }
716 }
717
718 if (flags & SWP_SIZE)
719 {
720 if (cy != pswpOld->cy)
721 flags |= SWP_MOVE;
722 }
723 else
724 {
725 cx = pswpOld->cx;
726 cy = pswpOld->cy;
727 }
728 y = parentHeight - y - cy;
729
730
731 if ((pswpOld->x == x) && (pswpOld->y == y))
732 flags &= ~SWP_MOVE;
733
734 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
735 flags &= ~SWP_SIZE;
736 }
737
738 pswp->fl = flags;
739 pswp->cy = cy;
740 pswp->cx = cx;
741 pswp->x = x;
742 pswp->y = y;
743 pswp->hwndInsertBehind = hWinAfter;
744 pswp->hwnd = hWindow;
745 pswp->ulReserved1 = 0;
746 pswp->ulReserved2 = 0;
747}
748//******************************************************************************
749//Position in screen coordinates
750//******************************************************************************
751void OSLibMapWINDOWPOStoSWPFrame(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
752{
753 BOOL fCvt = FALSE;
754
755 HWND hWnd = pwpos->hwnd;
756 HWND hWndInsertAfter = pwpos->hwndInsertAfter;
757 long x = pwpos->x;
758 long y = pwpos->y;
759 long cx = pwpos->cx;
760 long cy = pwpos->cy;
761 UINT fuFlags = pwpos->flags;
762 ULONG parentHeight;
763 POINTL point;
764
765 HWND hWinAfter;
766 ULONG flags = 0;
767 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP;
768
769 if (hWndInsertAfter == HWND_TOPMOST_W)
770// hWinAfter = HWND_TOPMOST;
771 hWinAfter = HWND_TOP;
772 else if (hWndInsertAfter == HWND_NOTOPMOST_W)
773// hWinAfter = HWND_NOTOPMOST;
774 hWinAfter = HWND_TOP;
775 else if (hWndInsertAfter == HWND_TOP_W)
776 hWinAfter = HWND_TOP;
777 else if (hWndInsertAfter == HWND_BOTTOM_W)
778 hWinAfter = HWND_BOTTOM;
779 else
780 hWinAfter = (HWND) hWndInsertAfter;
781
782 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE;
783 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE;
784 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER;
785 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW;
786 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE;
787 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW;
788 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE;
789 if ( fuFlags & SWP_NOSENDCHANGING_W) flags |= SWP_NOADJUST;
790
791 if (flags & (SWP_MOVE | SWP_SIZE))
792 {
793 point.x = x;
794 point.y = y;
795
796 if(hParent) {
797 parentHeight = OSLibGetWindowHeight(hParent);
798
799 point.y = ScreenHeight - point.y - cy;
800 WinMapWindowPoints(HWND_DESKTOP, hParent, &point, 1);
801 point.y = parentHeight - point.y - cy;
802 }
803 else parentHeight = ScreenHeight;
804
805 x = point.x;
806 y = point.y;
807
808 if (flags & SWP_SIZE)
809 {
810 if (cy != pswpOld->cy)
811 flags |= SWP_MOVE;
812 }
813 else
814 {
815 cx = pswpOld->cx;
816 cy = pswpOld->cy;
817 }
818 y = parentHeight - y - cy;
819
820
821 if ((pswpOld->x == x) && (pswpOld->y == y))
822 flags &= ~SWP_MOVE;
823
824 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
825 flags &= ~SWP_SIZE;
826 }
827
828 pswp->fl = flags;
829 pswp->cy = cy;
830 pswp->cx = cx;
831 pswp->x = x;
832 pswp->y = y;
833 pswp->hwndInsertBehind = hWinAfter;
834 pswp->hwnd = hWindow;
835 pswp->ulReserved1 = 0;
836 pswp->ulReserved2 = 0;
837}
838//******************************************************************************
839//******************************************************************************
840BOOL OSLibWinCalcFrameRect(HWND hwndFrame, RECT *pRect, BOOL fClient)
841{
842 BOOL rc;
843
844 WinMapWindowPoints(hwndFrame, HWND_DESKTOP, (PPOINTL)pRect, 2);
845
846 rc = WinCalcFrameRect(hwndFrame, (PRECTL)pRect, fClient);
847 WinMapWindowPoints(HWND_DESKTOP, hwndFrame, (PPOINTL)pRect, 2);
848
849 return rc;
850}
851//******************************************************************************
852//******************************************************************************
853BOOL OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax)
854{
855 TRACKINFO tinfo;
856
857 memset(&tinfo, 0, sizeof(TRACKINFO));
858 WinSendMsg(hwndFrame, WM_QUERYTRACKINFO, (MPARAM)0,(MPARAM)&tinfo);
859
860 pMinMax->ptMinTrackSize.x = tinfo.ptlMinTrackSize.x;
861 pMinMax->ptMinTrackSize.y = tinfo.ptlMinTrackSize.y;
862 pMinMax->ptMaxTrackSize.x = tinfo.ptlMaxTrackSize.x;
863 pMinMax->ptMaxTrackSize.y = tinfo.ptlMaxTrackSize.y;
864 return TRUE;
865}
866//******************************************************************************
867//******************************************************************************
868HWND OSLibWinBeginEnumWindows(HWND hwnd)
869{
870 if(hwnd == OSLIB_HWND_DESKTOP) hwnd = HWND_DESKTOP;
871 else
872 if(hwnd == OSLIB_HWND_OBJECT) hwnd = HWND_OBJECT;
873
874 return WinBeginEnumWindows(hwnd);
875}
876//******************************************************************************
877//******************************************************************************
878HWND OSLibWinGetNextWindow(HWND hwndEnum)
879{
880 return WinGetNextWindow(hwndEnum);
881}
882//******************************************************************************
883//******************************************************************************
884HWND OSLibWinQueryClientWindow(HWND hwndFrame)
885{
886 HWND hwndClient = 0;
887
888 if(((ULONG)WinSendMsg(hwndFrame, WM_QUERYFRAMEINFO, NULL, NULL)) & FI_FRAME)
889 hwndClient = WinWindowFromID(hwndFrame, FID_CLIENT);
890
891 return hwndClient;
892}
893//******************************************************************************
894//******************************************************************************
895BOOL OSLibWinEndEnumWindows(HWND hwndEnum)
896{
897 return WinEndEnumWindows(hwndEnum);
898}
899//******************************************************************************
900//******************************************************************************
901BOOL OSLibWinQueryWindowProcess(HWND hwnd, ULONG *pid, ULONG *tid)
902{
903 return WinQueryWindowProcess(hwnd, pid, tid);
904}
905//******************************************************************************
906//******************************************************************************
907BOOL OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num)
908{
909 return WinMapWindowPoints (hwndFrom, hwndTo, (PPOINTL)pptl, num);
910}
911//******************************************************************************
912//******************************************************************************
913BOOL OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable)
914{
915 HWND hwndScroll;
916
917 if(scrollBar == OSLIB_VSCROLL) {
918 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);
919 }
920 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);
921
922 if(hwndScroll == NULL)
923 return FALSE;
924
925 return WinEnableWindow(hwndScroll, fEnable);
926}
927//******************************************************************************
928//******************************************************************************
929HWND OSLibWinQueryObjectWindow(VOID)
930{
931 return WinQueryObjectWindow(HWND_DESKTOP);
932}
933//******************************************************************************
934//******************************************************************************
935BOOL OSLibWinShowScrollBar(HWND hwndParent, HWND hwndScroll, int scrollBar,
936 BOOL fShow, BOOL fForceChange)
937{
938 HWND hwndObj = WinQueryObjectWindow(HWND_DESKTOP),hwndCurPar = WinQueryWindow(hwndScroll,QW_PARENT);
939
940 if(hwndScroll == NULL) {
941 dprintf(("OSLibWinShowScrollBar: scrollbar %d (parent %x) not found!", scrollBar, hwndParent));
942 return FALSE;
943 }
944
945 if ((fShow && hwndCurPar == hwndObj) || (!fShow && hwndCurPar != hwndObj) || fForceChange)
946 {
947 //CB: bug: winhlp32: hide vert scrollbar on maximize doesn't update the frame
948 WinSetParent(hwndScroll,fShow ? hwndParent:HWND_OBJECT,FALSE);
949 WinSendMsg(hwndParent, WM_UPDATEFRAME,
950 MPFROMLONG( ( scrollBar == OSLIB_VSCROLL ) ? FCF_VERTSCROLL
951 : FCF_HORZSCROLL),
952 MPVOID );
953 }
954 return TRUE;
955}
956//******************************************************************************
957//******************************************************************************
958HWND OSLibWinQueryScrollBarHandle(HWND hwndParent, int scrollBar)
959{
960 if(scrollBar == OSLIB_VSCROLL) {
961 return WinWindowFromID(hwndParent, FID_VERTSCROLL);
962 }
963 else return WinWindowFromID(hwndParent, FID_HORZSCROLL);
964}
965//******************************************************************************
966//******************************************************************************
967ULONG OSLibWinGetScrollPos(HWND hwndParent, HWND hwndScroll)
968{
969 if(hwndScroll == NULL)
970 return 0;
971
972 return (ULONG)WinSendMsg(hwndScroll, SBM_QUERYPOS, 0, 0);
973}
974//******************************************************************************
975//******************************************************************************
976ULONG OSLibWinSetScrollPos(HWND hwndParent, HWND hwndScroll, int pos, int fRedraw)
977{
978 ULONG oldPos;
979
980 if(hwndScroll == NULL)
981 return 0;
982
983 oldPos = (ULONG)WinSendMsg(hwndScroll, SBM_QUERYPOS, 0, 0);
984
985 if(WinSendMsg(hwndScroll, SBM_SETPOS, MPFROMSHORT(pos), MPFROMLONG(fRedraw)) == FALSE)
986 return 0;
987
988 return oldPos;
989}
990//******************************************************************************
991//******************************************************************************
992BOOL OSLibWinSetScrollRange(HWND hwndParent, HWND hwndScroll, int minpos,
993 int maxpos, int fRedraw)
994{
995 if(hwndScroll == NULL)
996 return 0;
997
998 return (BOOL)WinSendMsg( hwndScroll, SBM_SETSCROLLBAR,
999 MPFROMLONG(WinSendMsg(hwndScroll, SBM_QUERYPOS, 0, 0)),
1000 MPFROM2SHORT( minpos ,maxpos ) );
1001}
1002//******************************************************************************
1003//******************************************************************************
1004BOOL OSLibWinSetScrollPageSize(HWND hwndParent, HWND hwndScroll, int pagesize,
1005 int totalsize, int fRedraw)
1006{
1007 if(hwndScroll == NULL)
1008 return 0;
1009
1010 return (BOOL)WinSendMsg( hwndScroll, SBM_SETTHUMBSIZE,
1011 MPFROM2SHORT(pagesize, totalsize),
1012 0);
1013}
1014//******************************************************************************
1015//******************************************************************************
1016void OSLibTranslateScrollCmdAndMsg(ULONG *msg, ULONG *scrollcmd)
1017{
1018 switch(*scrollcmd)
1019 {
1020 case SB_LINEUP:
1021 *scrollcmd = SB_LINEUP_W;
1022 break;
1023 case SB_LINEDOWN:
1024 *scrollcmd = SB_LINEDOWN_W;
1025 break;
1026 case SB_PAGEUP:
1027 *scrollcmd = SB_PAGEUP_W;
1028 break;
1029 case SB_PAGEDOWN:
1030 *scrollcmd = SB_PAGEDOWN_W;
1031 break;
1032 case SB_SLIDERTRACK:
1033 *scrollcmd = SB_THUMBTRACK_W;
1034 break;
1035 case SB_SLIDERPOSITION:
1036 *scrollcmd = SB_THUMBPOSITION_W;
1037 break;
1038 case SB_ENDSCROLL:
1039 *scrollcmd = SB_ENDSCROLL_W;
1040 break;
1041 }
1042 *msg = (*msg == WM_HSCROLL) ? WM_HSCROLL_W : WM_VSCROLL_W;
1043 return;
1044}
1045//******************************************************************************
1046//******************************************************************************
1047void OSLibSetWindowStyle(HWND hwnd, ULONG dwStyle)
1048{
1049 ULONG OSWinStyle, OSFrameStyle, borderWidth, borderHeight,dwExStyle;
1050
1051 OSLibWinConvertStyle(dwStyle, &dwExStyle, &OSWinStyle, &OSFrameStyle, &borderWidth, &borderHeight);
1052
1053 OSWinStyle = OSWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
1054
1055 WinSetWindowULong(hwnd, QWL_STYLE,
1056 (WinQueryWindowULong(hwnd, QWL_STYLE) & ~0xffff0000) |
1057 OSWinStyle);
1058
1059 //CB: bug: it doesn't work with child windows!
1060
1061 if(OSFrameStyle & FCF_TITLEBAR)
1062 {
1063 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_TITLEBAR), hwnd, FALSE);
1064 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_MENU), hwnd, FALSE);
1065 }
1066 else
1067 {
1068 WinSetParent(WinWindowFromID(hwnd, FID_TITLEBAR), HWND_OBJECT, FALSE);
1069 WinSetParent(WinWindowFromID(hwnd, FID_MENU), HWND_OBJECT, FALSE);
1070 }
1071 if(OSFrameStyle & FCF_SYSMENU)
1072 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_SYSMENU), hwnd, FALSE);
1073 else
1074 WinSetParent(WinWindowFromID(hwnd, FID_SYSMENU), HWND_OBJECT, FALSE);
1075
1076 if(OSFrameStyle & FCF_MINBUTTON | OSFrameStyle & FCF_MAXBUTTON)
1077 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_MINMAX), hwnd, FALSE);
1078 else
1079 WinSetParent(WinWindowFromID(hwnd, FID_MINMAX), HWND_OBJECT, FALSE);
1080
1081 if(OSFrameStyle & FCF_VERTSCROLL)
1082 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_VERTSCROLL), hwnd, FALSE);
1083 else
1084 WinSetParent(WinWindowFromID(hwnd, FID_VERTSCROLL), HWND_OBJECT, FALSE);
1085
1086 if(OSFrameStyle & FCF_HORZSCROLL)
1087 WinSetParent(OSLibWinObjectWindowFromID(hwnd, FID_HORZSCROLL), hwnd, FALSE);
1088 else
1089 WinSetParent(WinWindowFromID(hwnd, FID_HORZSCROLL), HWND_OBJECT, FALSE);
1090
1091#if 0
1092 WNDPARAMS wndparam = {0};
1093 FRAMECDATA framecdata = {0};
1094
1095 framecdata.cb = sizeof(FRAMECDATA);
1096
1097 wndparam.fsStatus = WPM_CTLDATA;
1098 wndparam.cbCtlData = framecdata.cb;
1099 wndparam.pCtlData = (PVOID)&framecdata;
1100 WinSendMsg(hwnd, WM_QUERYWINDOWPARAMS, &wndparam, 0);
1101
1102 wndparam.fsStatus = WPM_CTLDATA;
1103 wndparam.pCtlData = (PVOID)&framecdata;
1104 framecdata.flCreateFlags = OSFrameStyle;
1105 WinSendMsg(hwnd, WM_SETWINDOWPARAMS, &wndparam, 0);
1106#endif
1107
1108 WinSendMsg(hwnd, WM_UPDATEFRAME,
1109 MPFROMLONG(FCF_TITLEBAR | FCF_SYSMENU | FCF_MINMAX |
1110 FCF_MENU | FCF_VERTSCROLL | FCF_HORZSCROLL),
1111 MPVOID);
1112}
1113//******************************************************************************
1114//******************************************************************************
1115HWND OSLibWinObjectWindowFromID(HWND hwndOwner, ULONG ID)
1116{
1117 HWND hwndNext, hwndFound=0;
1118 HENUM henum;
1119
1120 henum = WinBeginEnumWindows(HWND_OBJECT);
1121 while ((hwndNext = WinGetNextWindow(henum)) != 0)
1122 {
1123 if(WinQueryWindow(hwndNext, QW_OWNER) == hwndOwner &&
1124 WinQueryWindowUShort(hwndNext, QWS_ID) == ID)
1125 {
1126 hwndFound = hwndNext;
1127 break;
1128 }
1129 }
1130 WinEndEnumWindows(henum);
1131 return hwndFound;
1132}
1133//******************************************************************************
1134//******************************************************************************
1135BOOL OSLibSetWindowID(HWND hwnd, ULONG value)
1136{
1137 dprintf(("OSLibSetWindowID hwnd:%x ID:%x", hwnd, value));
1138 return WinSetWindowULong(hwnd, QWS_ID, value);
1139}
1140//******************************************************************************
1141//******************************************************************************
1142PVOID OSLibWinSubclassWindow(HWND hwnd,PVOID newWndProc)
1143{
1144 return WinSubclassWindow(hwnd,(PFNWP)newWndProc);
1145}
1146//******************************************************************************
1147//******************************************************************************
1148BOOL OSLibSetWindowRestoreRect(HWND hwnd, PRECT pRect)
1149{
1150 ULONG yHeight = OSLibGetWindowHeight(WinQueryWindow(hwnd, QW_PARENT));
1151
1152 WinSetWindowUShort(hwnd, QWS_XRESTORE, (USHORT)pRect->left );
1153 WinSetWindowUShort(hwnd, QWS_YRESTORE, (USHORT)(yHeight - pRect->top -
1154 (pRect->bottom - pRect->top)));
1155 WinSetWindowUShort(hwnd, QWS_CXRESTORE, (USHORT)(pRect->right - pRect->left));
1156 WinSetWindowUShort(hwnd, QWS_CYRESTORE, (USHORT)(pRect->bottom - pRect->top));
1157 return TRUE;
1158}
1159//******************************************************************************
1160//******************************************************************************
1161BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y)
1162{
1163 ULONG yHeight = OSLibGetWindowHeight(WinQueryWindow(hwnd, QW_PARENT));
1164
1165 WinSetWindowUShort(hwnd, QWS_XMINIMIZE, (USHORT)x );
1166 WinSetWindowUShort(hwnd, QWS_YMINIMIZE, (USHORT)(yHeight - y -
1167 ( 2 * WinQuerySysValue( HWND_DESKTOP, SV_CYSIZEBORDER)) -
1168 WinQuerySysValue( HWND_DESKTOP, SV_CYICON)));
1169 return TRUE;
1170}
1171//******************************************************************************
1172//******************************************************************************
Note: See TracBrowser for help on using the repository browser.