Ignore:
Timestamp:
Jan 31, 2000, 11:30:52 PM (26 years ago)
Author:
sandervl
Message:

GetDCEx changes (fail if hwnd == 0)

File:
1 edited

Legend:

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

    r2569 r2582  
    1 /* $Id: dc.cpp,v 1.40 2000-01-29 20:46:52 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.41 2000-01-31 22:30:51 sandervl Exp $ */
    22
    33/*
     
    6868BOOL changePageXForm(Win32BaseWindow *wnd, pDCData pHps, PPOINTL pValue, int x, int y, PPOINTL pPrev);
    6969LONG clientHeight(Win32BaseWindow *wnd, HWND hwnd, pDCData pHps);
     70
     71HWND WIN32API GetDesktopWindow(void);
    7072
    7173//******************************************************************************
     
    663665   BOOL     creatingOwnDC = FALSE;
    664666   PS_Type  psType;
     667
     668   if(hwnd == 0) {
     669        dprintf(("error: GetDCEx window %x not found", hwnd));
     670        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     671        return 0;
     672   }
    665673
    666674   if (hwnd)
     
    683691                hWindow = wnd->getOS2WindowHandle();
    684692   }
    685    else
    686       hWindow = HWND_DESKTOP;
    687693
    688694   //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)
     
    809815HDC WIN32API GetDC (HWND hwnd)
    810816{
     817  if(!hwnd)
     818       return GetDCEx( GetDesktopWindow(), 0, DCX_CACHE_W | DCX_WINDOW_W );
    811819  return GetDCEx (hwnd, NULL, 0);
    812820}
     
    815823HDC WIN32API GetWindowDC (HWND hwnd)
    816824{
    817   return GetDCEx (hwnd, NULL, DCX_WINDOW_W);
     825  if (!hwnd) hwnd = GetDesktopWindow();
     826  return GetDCEx (hwnd, NULL, DCX_USESTYLE_W | DCX_WINDOW_W);
    818827}
    819828//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.