Changeset 2582 for trunk/src


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

GetDCEx changes (fail if hwnd == 0)

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r2469 r2582  
    1 /* $Id: controls.cpp,v 1.8 2000-01-18 20:10:32 sandervl Exp $ */
     1/* $Id: controls.cpp,v 1.9 2000-01-31 22:30:51 sandervl Exp $ */
    22/* File: controls.cpp -- Win32 common controls
    33 *
     
    2828void CONTROLS_Register()
    2929{
     30  dprintf(("Register DESKTOP class"));
     31  controlAtoms[DESKTOP_CONTROL] = DESKTOP_Register();
     32  if (!controlAtoms[DESKTOP_CONTROL]) dprintf(("failed!!!"));
     33
     34  //SvL: Create Desktop Window
     35  CreateWin32Desktop();
     36
    3037  dprintf(("Register BUTTON class"));
    3138  controlAtoms[BUTTON_CONTROL] = BUTTON_Register();
     
    6370  controlAtoms[DIALOG_CONTROL] = DIALOG_Register();
    6471  if (!controlAtoms[DIALOG_CONTROL]) dprintf(("failed!!!"));
    65 
    66   dprintf(("Register DESKTOP class"));
    67   controlAtoms[DESKTOP_CONTROL] = DESKTOP_Register();
    68   if (!controlAtoms[DESKTOP_CONTROL]) dprintf(("failed!!!"));
    6972
    7073  dprintf(("Register WINSWITCH class"));
  • 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//******************************************************************************
  • trunk/src/user32/dc.h

    r2469 r2582  
    1 /* $Id: dc.h,v 1.10 2000-01-18 20:08:09 sandervl Exp $ */
     1/* $Id: dc.h,v 1.11 2000-01-31 22:30:51 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    9595#define DCX_INTERSECTUPDATE_W           0x00000200L
    9696#define DCX_LOCKWINDOWUPDATE_W          0x00000400L
     97#define DCX_USESTYLE_W                  0x00010000L
    9798#define DCX_VALIDATE_W                  0x00200000L
    9899
  • trunk/src/user32/initterm.cpp

    r2469 r2582  
    1 /* $Id: initterm.cpp,v 1.18 2000-01-18 20:10:36 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.19 2000-01-31 22:30:51 sandervl Exp $ */
    22
    33/*
     
    115115         MONITOR_Initialize(&MONITOR_PrimaryMonitor);
    116116
    117          //SvL: Create Desktop Window
    118          if(CreateWin32Desktop() == FALSE) {
    119                 return 0UL;
    120          }
    121 
    122117         break;
    123118      case 1 :
  • trunk/src/user32/menu.cpp

    r2577 r2582  
    1 /* $Id: menu.cpp,v 1.13 2000-01-30 18:48:27 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.14 2000-01-31 22:30:52 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    17051705
    17061706    //debug_print_menuitem("MENU_SetItemData from: ", item, "");
     1707
    17071708
    17081709    if (IS_STRING_ITEM(flags))
     
    41254126                                 const MENUITEMINFOA *lpmii)
    41264127{
    4127     dprintf(("USER32: SetMenuItemInfoA"));
     4128    dprintf(("USER32: SetMenuItemInfoA %x %d %d %x", hmenu, item, bypos, lpmii));
    41284129
    41294130    return SetMenuItemInfo_common(MENU_FindItem(&hmenu, &item, bypos? MF_BYPOSITION : 0),
     
    42444245    MENUITEM *item = MENU_InsertItem(hMenu, uItem, bypos ? MF_BYPOSITION : 0 );
    42454246
    4246     dprintf(("USER32: InsertMenuItemA"));
     4247    dprintf(("USER32: InsertMenuItemA %x %d %d %x", hMenu, uItem, bypos, lpmii->wID));
    42474248
    42484249    return SetMenuItemInfo_common(item, lpmii, FALSE);
  • trunk/src/user32/oslibwin.h

    r2469 r2582  
    1 /* $Id: oslibwin.h,v 1.35 2000-01-18 20:08:12 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.36 2000-01-31 22:30:52 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3030#endif
    3131
     32//SvL: Must be the same as HWND_DESKTOP/OBJECT in pmwin.h!
    3233#define OSLIB_HWND_DESKTOP      1
    3334#define OSLIB_HWND_OBJECT       2
Note: See TracChangeset for help on using the changeset viewer.