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

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

ShowScrollBar fix

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