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

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

fixed window text handling

File size: 41.5 KB
Line 
1/* $Id: oslibwin.cpp,v 1.46 1999-11-21 17:07:50 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 BOOL rc;
436 HWND hwndClient;
437
438 rc = WinEnableWindow(hwnd, fEnable);
439 hwndClient = WinWindowFromID(hwnd, FID_CLIENT);
440 if(hwndClient) {
441 WinEnableWindow(hwndClient, fEnable);
442 }
443 return rc;
444}
445//******************************************************************************
446//******************************************************************************
447BOOL OSLibWinIsWindowEnabled(HWND hwnd)
448{
449 return WinIsWindowEnabled(hwnd);
450}
451//******************************************************************************
452//******************************************************************************
453BOOL OSLibWinIsWindowVisible(HWND hwnd)
454{
455 return WinIsWindowVisible(hwnd);
456}
457//******************************************************************************
458//******************************************************************************
459BOOL OSLibWinQueryActiveWindow()
460{
461 return WinQueryActiveWindow(HWND_DESKTOP);
462}
463//******************************************************************************
464//******************************************************************************
465LONG OSLibWinQueryWindowTextLength(HWND hwnd)
466{
467 return WinQueryWindowTextLength(hwnd);
468}
469//******************************************************************************
470//******************************************************************************
471LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz)
472{
473 return WinQueryWindowText(hwnd, length, lpsz);
474}
475//******************************************************************************
476//******************************************************************************
477BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz)
478{
479 return WinSetWindowText(hwnd, lpsz);
480}
481//******************************************************************************
482//******************************************************************************
483BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash)
484{
485 return WinFlashWindow(hwnd, fFlash);
486}
487//******************************************************************************
488//******************************************************************************
489HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint)
490{
491 return WinWindowFromPoint((hwnd == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP : hwnd, (PPOINTL)ppoint, TRUE);
492}
493//******************************************************************************
494//******************************************************************************
495BOOL OSLibWinMinimizeWindow(HWND hwnd)
496{
497 return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_MINIMIZE);
498}
499//******************************************************************************
500//******************************************************************************
501BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl)
502{
503 pointl->x = 0;
504 pointl->y = 0;
505 return (BOOL) WinSendMsg(hwnd, WM_QUERYBORDERSIZE, MPFROMP( &pointl), 0);
506}
507//******************************************************************************
508//******************************************************************************
509BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon)
510{
511 return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0);
512}
513//******************************************************************************
514//******************************************************************************
515BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp)
516{
517 return WinQueryWindowPos(hwnd, pswp);
518}
519//******************************************************************************
520//******************************************************************************
521void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
522{
523 HWND hWindow = pswp->hwnd;
524 HWND hWndInsertAfter = pswp->hwndInsertBehind;
525 long x = pswp->x;
526 long y = pswp->y;
527 long cx = pswp->cx;
528 long cy = pswp->cy;
529 UINT fuFlags = (UINT)pswp->fl;
530 ULONG parentHeight;
531
532 HWND hWinAfter;
533 ULONG flags = 0;
534 SWP swpFrame, swpClient;
535 POINTL point;
536
537 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
538
539 if (hWndInsertAfter == HWND_TOP)
540 hWinAfter = HWND_TOP_W;
541 else if (hWndInsertAfter == HWND_BOTTOM)
542 hWinAfter = HWND_BOTTOM_W;
543 else
544 hWinAfter = (HWND) hWndInsertAfter;
545
546 //***********************************
547 // convert PM flags to Windows flags
548 //***********************************
549 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W;
550 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W;
551 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W;
552 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W;
553 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W;
554 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W;
555 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W;
556 if ( fuFlags & SWP_NOADJUST) flags |= SWP_NOSENDCHANGING_W;
557
558 WinQueryWindowPos(hFrame, &swpFrame);
559
560 if(fuFlags & (SWP_MOVE | SWP_SIZE))
561 {
562 point.x = swpFrame.x;
563 point.y = swpFrame.y;
564 if(hParent)
565 {
566 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
567 }
568 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy;
569
570 cy = swpFrame.cy;
571 cx = swpFrame.cx;
572 x = point.x;
573 y = point.y;
574
575 if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
576 flags |= SWP_NOMOVE_W;
577
578 if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
579 flags |= SWP_NOSIZE_W;
580
581 if (fuFlags & SWP_SIZE)
582 {
583 if (pswp->cy != pswpOld->cy)
584 {
585 flags &= ~SWP_NOMOVE_W;
586 }
587 }
588 }
589
590 pswpOld->x = pswp->x;
591 pswpOld->y = swpFrame.cy - pswp->y - pswp->cy;
592 pswpOld->cx = pswp->cx;
593 pswpOld->cy = pswp->cy;
594
595 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)",
596 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
597
598 pwpos->flags = (UINT)flags;
599 pwpos->cy = cy;
600 pwpos->cx = cx;
601 pwpos->x = x;
602 pwpos->y = y;
603 pwpos->hwndInsertAfter = hWinAfter;
604 pwpos->hwnd = hWindow;
605}
606//******************************************************************************
607//******************************************************************************
608void OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
609{
610 HWND hWindow = pswp->hwnd;
611 HWND hWndInsertAfter = pswp->hwndInsertBehind;
612 long x = pswp->x;
613 long y = pswp->y;
614 long cx = pswp->cx;
615 long cy = pswp->cy;
616 UINT fuFlags = (UINT)pswp->fl;
617 ULONG parentHeight;
618
619 HWND hWinAfter;
620 ULONG flags = 0;
621 SWP swpClient;
622 POINTL point;
623
624 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
625
626 if (hWndInsertAfter == HWND_TOP)
627 hWinAfter = HWND_TOP_W;
628 else if (hWndInsertAfter == HWND_BOTTOM)
629 hWinAfter = HWND_BOTTOM_W;
630 else
631 hWinAfter = (HWND) hWndInsertAfter;
632
633 //***********************************
634 // convert PM flags to Windows flags
635 //***********************************
636 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W;
637 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W;
638 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W;
639 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W;
640 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W;
641 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W;
642 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W;
643 if ( fuFlags & SWP_NOADJUST) flags |= SWP_NOSENDCHANGING_W;
644
645 WinQueryWindowPos(WinWindowFromID(hFrame, FID_CLIENT), &swpClient);
646
647 if(fuFlags & (SWP_MOVE | SWP_SIZE))
648 {
649 point.x = x;
650 point.y = y;
651 if(hParent)
652 {
653 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
654 }
655 point.y = OSLibQueryScreenHeight() - point.y - cy;
656
657 x = point.x;
658 y = point.y;
659
660 if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
661 flags |= SWP_NOMOVE_W;
662
663 if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
664 flags |= SWP_NOSIZE_W;
665
666 if (fuFlags & SWP_SIZE)
667 {
668 if (pswp->cy != pswpOld->cy)
669 {
670 flags &= ~SWP_NOMOVE_W;
671 }
672 }
673 }
674
675 pswpOld->x = swpClient.x;
676 pswpOld->y = pswp->cy - swpClient.y - swpClient.cy;
677 pswpOld->cx = swpClient.cx;
678 pswpOld->cy = swpClient.cy;
679
680 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)",
681 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
682
683 pwpos->flags = (UINT)flags;
684 pwpos->cy = cy;
685 pwpos->cx = cx;
686 pwpos->x = x;
687 pwpos->y = y;
688 pwpos->hwndInsertAfter = hWinAfter;
689 pwpos->hwnd = hWindow;
690}
691//******************************************************************************
692//******************************************************************************
693void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
694{
695 BOOL fCvt = FALSE;
696
697 HWND hWnd = pwpos->hwnd;
698 HWND hWndInsertAfter = pwpos->hwndInsertAfter;
699 long x = pwpos->x;
700 long y = pwpos->y;
701 long cx = pwpos->cx;
702 long cy = pwpos->cy;
703 UINT fuFlags = pwpos->flags;
704 ULONG parentHeight;
705
706 HWND hWinAfter;
707 ULONG flags = 0;
708 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP;
709
710 if (hWndInsertAfter == HWND_TOPMOST_W)
711// hWinAfter = HWND_TOPMOST;
712 hWinAfter = HWND_TOP;
713 else if (hWndInsertAfter == HWND_NOTOPMOST_W)
714// hWinAfter = HWND_NOTOPMOST;
715 hWinAfter = HWND_TOP;
716 else if (hWndInsertAfter == HWND_TOP_W)
717 hWinAfter = HWND_TOP;
718 else if (hWndInsertAfter == HWND_BOTTOM_W)
719 hWinAfter = HWND_BOTTOM;
720 else
721 hWinAfter = (HWND) hWndInsertAfter;
722
723 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE;
724 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE;
725 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER;
726 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW;
727 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE;
728 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW;
729 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE;
730 if ( fuFlags & SWP_NOSENDCHANGING_W) flags |= SWP_NOADJUST;
731
732 if (flags & (SWP_MOVE | SWP_SIZE))
733 {
734 if (hParent == NULLHANDLE)
735 parentHeight = ScreenHeight;
736 else
737 parentHeight = OSLibGetWindowHeight(hParent);
738
739 if ((flags & SWP_MOVE) == 0)
740 {
741 x = pswpOld->x;
742 y = pswpOld->y;
743
744 if (!((y == 0) && (pswpOld->cy == 0)))
745 {
746 y = parentHeight - y - pswpOld->cy;
747 }
748 }
749
750 if (flags & SWP_SIZE)
751 {
752 if (cy != pswpOld->cy)
753 flags |= SWP_MOVE;
754 }
755 else
756 {
757 cx = pswpOld->cx;
758 cy = pswpOld->cy;
759 }
760 y = parentHeight - y - cy;
761
762
763 if ((pswpOld->x == x) && (pswpOld->y == y))
764 flags &= ~SWP_MOVE;
765
766 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
767 flags &= ~SWP_SIZE;
768 }
769
770 pswp->fl = flags;
771 pswp->cy = cy;
772 pswp->cx = cx;
773 pswp->x = x;
774 pswp->y = y;
775 pswp->hwndInsertBehind = hWinAfter;
776 pswp->hwnd = hWindow;
777 pswp->ulReserved1 = 0;
778 pswp->ulReserved2 = 0;
779}
780//******************************************************************************
781//Position in screen coordinates
782//******************************************************************************
783void OSLibMapWINDOWPOStoSWPFrame(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
784{
785 BOOL fCvt = FALSE;
786
787 HWND hWnd = pwpos->hwnd;
788 HWND hWndInsertAfter = pwpos->hwndInsertAfter;
789 long x = pwpos->x;
790 long y = pwpos->y;
791 long cx = pwpos->cx;
792 long cy = pwpos->cy;
793 UINT fuFlags = pwpos->flags;
794 ULONG parentHeight;
795 POINTL point;
796
797 HWND hWinAfter;
798 ULONG flags = 0;
799 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP;
800
801 if (hWndInsertAfter == HWND_TOPMOST_W)
802// hWinAfter = HWND_TOPMOST;
803 hWinAfter = HWND_TOP;
804 else if (hWndInsertAfter == HWND_NOTOPMOST_W)
805// hWinAfter = HWND_NOTOPMOST;
806 hWinAfter = HWND_TOP;
807 else if (hWndInsertAfter == HWND_TOP_W)
808 hWinAfter = HWND_TOP;
809 else if (hWndInsertAfter == HWND_BOTTOM_W)
810 hWinAfter = HWND_BOTTOM;
811 else
812 hWinAfter = (HWND) hWndInsertAfter;
813
814 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE;
815 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE;
816 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER;
817 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW;
818 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE;
819 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW;
820 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE;
821 if ( fuFlags & SWP_NOSENDCHANGING_W) flags |= SWP_NOADJUST;
822
823 if (flags & (SWP_MOVE | SWP_SIZE))
824 {
825 point.x = x;
826 point.y = y;
827
828 if(hParent) {
829 parentHeight = OSLibGetWindowHeight(hParent);
830
831 point.y = ScreenHeight - point.y - cy;
832 WinMapWindowPoints(HWND_DESKTOP, hParent, &point, 1);
833 point.y = parentHeight - point.y - cy;
834 }
835 else parentHeight = ScreenHeight;
836
837 x = point.x;
838 y = point.y;
839
840 if (flags & SWP_SIZE)
841 {
842 if (cy != pswpOld->cy)
843 flags |= SWP_MOVE;
844 }
845 else
846 {
847 cx = pswpOld->cx;
848 cy = pswpOld->cy;
849 }
850 y = parentHeight - y - cy;
851
852
853 if ((pswpOld->x == x) && (pswpOld->y == y))
854 flags &= ~SWP_MOVE;
855
856 if ((pswpOld->cx == cx) && (pswpOld->cy == cy))
857 flags &= ~SWP_SIZE;
858 }
859
860 pswp->fl = flags;
861 pswp->cy = cy;
862 pswp->cx = cx;
863 pswp->x = x;
864 pswp->y = y;
865 pswp->hwndInsertBehind = hWinAfter;
866 pswp->hwnd = hWindow;
867 pswp->ulReserved1 = 0;
868 pswp->ulReserved2 = 0;
869}
870//******************************************************************************
871//******************************************************************************
872BOOL OSLibWinCalcFrameRect(HWND hwndFrame, RECT *pRect, BOOL fClient)
873{
874 BOOL rc;
875
876 WinMapWindowPoints(hwndFrame, HWND_DESKTOP, (PPOINTL)pRect, 2);
877
878 rc = WinCalcFrameRect(hwndFrame, (PRECTL)pRect, fClient);
879 WinMapWindowPoints(HWND_DESKTOP, hwndFrame, (PPOINTL)pRect, 2);
880
881 return rc;
882}
883//******************************************************************************
884//******************************************************************************
885BOOL OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax)
886{
887 TRACKINFO tinfo;
888
889 memset(&tinfo, 0, sizeof(TRACKINFO));
890 WinSendMsg(hwndFrame, WM_QUERYTRACKINFO, (MPARAM)0,(MPARAM)&tinfo);
891
892 pMinMax->ptMinTrackSize.x = tinfo.ptlMinTrackSize.x;
893 pMinMax->ptMinTrackSize.y = tinfo.ptlMinTrackSize.y;
894 pMinMax->ptMaxTrackSize.x = tinfo.ptlMaxTrackSize.x;
895 pMinMax->ptMaxTrackSize.y = tinfo.ptlMaxTrackSize.y;
896 return TRUE;
897}
898//******************************************************************************
899//******************************************************************************
900HWND OSLibWinBeginEnumWindows(HWND hwnd)
901{
902 if(hwnd == OSLIB_HWND_DESKTOP) hwnd = HWND_DESKTOP;
903 else
904 if(hwnd == OSLIB_HWND_OBJECT) hwnd = HWND_OBJECT;
905
906 return WinBeginEnumWindows(hwnd);
907}
908//******************************************************************************
909//******************************************************************************
910HWND OSLibWinGetNextWindow(HWND hwndEnum)
911{
912 return WinGetNextWindow(hwndEnum);
913}
914//******************************************************************************
915//******************************************************************************
916HWND OSLibWinQueryClientWindow(HWND hwndFrame)
917{
918 HWND hwndClient = 0;
919
920 if(((ULONG)WinSendMsg(hwndFrame, WM_QUERYFRAMEINFO, NULL, NULL)) & FI_FRAME)
921 hwndClient = WinWindowFromID(hwndFrame, FID_CLIENT);
922
923 return hwndClient;
924}
925//******************************************************************************
926//******************************************************************************
927BOOL OSLibWinEndEnumWindows(HWND hwndEnum)
928{
929 return WinEndEnumWindows(hwndEnum);
930}
931//******************************************************************************
932//******************************************************************************
933BOOL OSLibWinQueryWindowProcess(HWND hwnd, ULONG *pid, ULONG *tid)
934{
935 return WinQueryWindowProcess(hwnd, pid, tid);
936}
937//******************************************************************************
938//******************************************************************************
939BOOL OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num)
940{
941 return WinMapWindowPoints (hwndFrom, hwndTo, (PPOINTL)pptl, num);
942}
943//******************************************************************************
944//******************************************************************************
945BOOL OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable)
946{
947 HWND hwndScroll;
948
949 if(scrollBar == OSLIB_VSCROLL) {
950 hwndScroll = WinWindowFromID(hwndParent, FID_VERTSCROLL);
951 }
952 else hwndScroll = WinWindowFromID(hwndParent, FID_HORZSCROLL);
953
954 if(hwndScroll == NULL)
955 return FALSE;
956
957 return WinEnableWindow(hwndScroll, fEnable);
958}
959//******************************************************************************
960//******************************************************************************
961HWND OSLibWinQueryObjectWindow(VOID)
962{
963 return WinQueryObjectWindow(HWND_DESKTOP);
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 OSWinStyle = OSWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPCHILDREN);
1055
1056 WinSetWindowULong(hwnd, QWL_STYLE,
1057 (WinQueryWindowULong(hwnd, QWL_STYLE) & ~0xffff0000) |
1058 OSWinStyle);
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//******************************************************************************
1172BOOL OSLibWinGetKeyboardStateTable(unsigned char *PMKeyState)
1173{
1174 return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)&PMKeyState, FALSE );
1175}
1176//******************************************************************************
1177//******************************************************************************
1178BOOL OSLibWinSetKeyboardStateTable(unsigned char *PMKeyState)
1179{
1180 return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)&PMKeyState, TRUE );
1181}
1182//******************************************************************************
1183//******************************************************************************
Note: See TracBrowser for help on using the repository browser.