Ignore:
Timestamp:
Jul 17, 1999, 11:17:58 AM (26 years ago)
Author:
sandervl
Message:

Lots of changes/additions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/oslibwin.cpp

    r314 r319  
    1 /* $Id: oslibwin.cpp,v 1.4 1999-07-16 11:32:08 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1414#include <os2.h>
    1515#include <os2wrap.h>
     16#include <misc.h>
    1617#include <oslibwin.h>
    1718#include "oslibstyle.h"
     19#include "oslibutil.h"
    1820#include "pmwindow.h"
    1921
     
    3335HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    3436                          char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy,
    35                           HWND Owner, ULONG fHWND_BOTTOM)
     37                          HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
    3638{
    3739 HWND  hwndClient;
    38  HWND  hwndFrame;
    3940 RECTL rectl;
    4041
     
    4243        hwndParent = HWND_DESKTOP;
    4344  }
    44   if(WinQueryWindowRect(hwndParent, &rectl) == 0) {
     45  if(WinQueryWindowRect(hwndParent, &rectl) == TRUE) {
    4546        y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);
    4647  }
    4748  if(dwFrameStyle) {
    4849        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
    49         hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
     50        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    5051                                       &dwFrameStyle, WIN32_STDCLASS,
    5152                                       "", 0, 0, 0, &hwndClient) != 0;
    52         if(hwndFrame) {
     53        if(*hwndFrame) {
    5354                if(pszName) {
    54                         WinSetWindowText(hwndFrame, pszName);
     55                        WinSetWindowText(*hwndFrame, pszName);
    5556                }
    56                 WinSetWindowPos(hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,
     57                WinSetWindowPos(*hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,
    5758                                x, y, cx, cy, SWP_SIZE | SWP_MOVE);
    5859
    59                 return hwndFrame;
     60                return hwndClient;
    6061        }
     62        dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
    6163        return 0;
    6264  }
    63   else  return WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
     65  hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,
    6466                               Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,
    6567                               NULL);
     68  *hwndFrame = hwndClient;
     69  return hwndClient;
    6670}
    6771//******************************************************************************
     
    143147//******************************************************************************
    144148//******************************************************************************
     149BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx,
     150                          LONG cy, ULONG fl)
     151{
     152  return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
     153}
     154//******************************************************************************
     155//******************************************************************************
     156BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl)
     157{
     158  return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);
     159}
     160//******************************************************************************
     161//******************************************************************************
     162BOOL OSLibWinDestroyWindow(HWND hwnd)
     163{
     164  return WinDestroyWindow(hwnd);
     165}
     166//******************************************************************************
     167//******************************************************************************
     168BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect)
     169{
     170  return WinQueryUpdateRect(hwnd, (RECTL *)pRect);
     171}
     172//******************************************************************************
     173//******************************************************************************
     174BOOL OSLibWinIsIconic(HWND hwnd)
     175{
     176 SWP  swp;
     177 BOOL rc;
     178
     179  rc = WinQueryWindowPos(hwnd, &swp);
     180  if(rc == FALSE) {
     181        dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));
     182        return FALSE;
     183  }
     184
     185  if(swp.fl & SWP_MINIMIZE)
     186        return TRUE;
     187  else  return FALSE;
     188}
     189//******************************************************************************
     190//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.