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

Last change on this file since 1511 was 1511, checked in by cbratschi, 26 years ago

scrollbar updates

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