Ignore:
Timestamp:
Jun 7, 2000, 11:45:52 PM (25 years ago)
Author:
sandervl
Message:

Set/GetParent changes/fixes

File:
1 edited

Legend:

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

    r3662 r3663  
    1 /* $Id: window.cpp,v 1.68 2000-06-07 14:51:33 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.69 2000-06-07 21:45:52 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    318318        return 0;
    319319    }
     320    if(window->isDesktopWindow()) {
     321        dprintf(("WARNING: Trying to destroy desktop window!"));
     322        return FALSE;
     323    }
    320324    return window->DestroyWindow();
    321325}
     
    353357HWND WIN32API SetParent( HWND hwndChild, HWND hwndNewParent)
    354358{
    355   Win32BaseWindow *window;
     359  Win32BaseWindow *window, *parent;
    356360
    357361    window = Win32BaseWindow::GetWindowFromHandle(hwndChild);
     
    360364        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    361365        return 0;
     366    }
     367    if(hwndNewParent == HWND_DESKTOP) {
     368        hwndNewParent = GetDesktopWindow();
     369    }
     370    else {
     371        parent = Win32BaseWindow::GetWindowFromHandle(hwndNewParent);
     372        if(!window) {
     373                dprintf(("SetParent, parent %x not found", hwndNewParent));
     374                SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     375                return 0;
     376        }
    362377    }
    363378    dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
Note: See TracChangeset for help on using the changeset viewer.