Ignore:
Timestamp:
Jan 2, 2000, 9:20:03 PM (26 years ago)
Author:
sandervl
Message:

Implemented Set/GetWindowRgn (not activated)

File:
1 edited

Legend:

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

    r2257 r2294  
    1 /* $Id: dc.cpp,v 1.31 1999-12-29 22:53:59 cbratschi Exp $ */
     1/* $Id: dc.cpp,v 1.32 2000-01-02 20:20:01 sandervl Exp $ */
    22
    33/*
     
    14281428 *****************************************************************************/
    14291429
    1430 int WIN32API GetWindowRgn (HWND hWnd,
    1431                               HRGN hRgn)
    1432 {
    1433   dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
    1434          hWnd,
    1435          hRgn));
    1436   //Attention: Win32 hwnd handle!
    1437 
    1438   return (NULLREGION_W);
     1430int WIN32API GetWindowRgn(HWND hwnd, HRGN hRgn)
     1431{
     1432  Win32BaseWindow *window;
     1433  HRGN hWindowRegion;
     1434
     1435    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1436    if(!window) {
     1437        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1438        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1439        return 0;
     1440    }
     1441    dprintf(("USER32:GetWindowRgn (%x,%x)", hwnd, hRgn));
     1442    hWindowRegion = window->GetWindowRegion();
     1443
     1444    return O32_CombineRgn(hRgn, hWindowRegion, 0, RGN_COPY_W);
    14391445}
    14401446/*****************************************************************************
     
    14441450 *             operating system permits drawing. The operating system does not
    14451451 *             display any portion of a window that lies outside of the window region
     1452 *             When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1453 *             WM_WINDOWPOSCHANGED messages to the window.
     1454 *
    14461455 * Parameters: HWND  hWnd    handle to window whose window region is to be set
    14471456 *             HRGN  hRgn    handle to region
     
    14561465 *****************************************************************************/
    14571466
    1458 int WIN32API SetWindowRgn(HWND hWnd,
    1459                              HRGN hRgn,
    1460                              BOOL bRedraw)
    1461 {
    1462   dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
    1463          hWnd,
    1464          hRgn,
    1465          bRedraw));
    1466   //Attention: Win32 hwnd handle!
    1467 
    1468   return (0);
     1467int WIN32API SetWindowRgn(HWND hwnd,
     1468                          HRGN hRgn,
     1469                          BOOL bRedraw)
     1470{
     1471  Win32BaseWindow *window;
     1472  HRGN hWindowRegion;
     1473
     1474    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1475    if(!window) {
     1476        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1477        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1478        return 0;
     1479    }
     1480    dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw));
     1481    window->SetWindowRegion(hRgn);
     1482    if(bRedraw) {
     1483        RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);     
     1484    }
     1485//TODO:
     1486//  When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1487//  WM_WINDOWPOSCHANGED messages to the window.
     1488    return 1;
    14691489}
    14701490//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.