Ignore:
Timestamp:
Oct 18, 2000, 7:10:50 PM (25 years ago)
Author:
sandervl
Message:

Get/SetWindowPlacement fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/window.cpp

    r4463 r4497  
    1 /* $Id: window.cpp,v 1.80 2000-10-09 17:26:55 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.81 2000-10-18 17:10:50 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    486486    if( IsWindow(hwnd) )
    487487    {
    488     WINDOWPLACEMENT wndpl;
    489     UINT flags;
     488        WINDOWPLACEMENT wndpl;
     489        UINT flags;
    490490
    491491        GetWindowPlacement(hwnd, &wndpl);
    492     wndpl.length  = sizeof(wndpl);
    493     wndpl.showCmd = showCmd;
    494     wndpl.flags = 0;
    495 
    496     if(lpPoint)
    497     {
     492        wndpl.length  = sizeof(wndpl);
     493        wndpl.showCmd = showCmd;
     494        wndpl.flags = 0;
     495
     496        if(lpPoint)
     497        {
    498498            wndpl.flags |= WPF_SETMINPOSITION;
    499         wndpl.ptMinPosition = *lpPoint;
    500     }
    501     if(lpRect)
    502     {
     499            wndpl.ptMinPosition = *lpPoint;
     500        }
     501        if(lpRect)
     502        {
    503503            wndpl.rcNormalPosition = *lpRect;
    504     }
     504        }
    505505        SetWindowPlacement( hwnd, &wndpl);
    506506    }
     
    593593}
    594594//******************************************************************************
     595//NOTE: length must equal structure size or else api fails (verified in NT4, SP6)
    595596//******************************************************************************
    596597BOOL WIN32API SetWindowPlacement(HWND hwnd, const WINDOWPLACEMENT *winpos)
     
    604605        return FALSE;
    605606    }
    606     if(!winpos) {
     607    if(!winpos || winpos->length != sizeof(WINDOWPLACEMENT)) {
    607608        dprintf(("SetWindowPlacement %x invalid parameter", hwnd));
    608609        SetLastError(ERROR_INVALID_PARAMETER);
     
    613614}
    614615//******************************************************************************
     616//NOTE: Length does not need to be correct (even though the SDK docs claim otherwise)
     617//      (Verified in NT4, SP6)
    615618//******************************************************************************
    616619BOOL WIN32API GetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT winpos)
     
    16301633 HWND hwnd;
    16311634
    1632     hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
    1633 
    1634     hwnd = Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd));
     1635    hwnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
     1636    hwnd = Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hwnd));
    16351637
    16361638    dprintf(("GetLastActivePopup %x returned %x NOT CORRECTLY IMPLEMENTED", hWnd, hwnd));
Note: See TracChangeset for help on using the changeset viewer.