示例#1
0
文件: brush.c 项目: GYGit/reactos
/*
 * @implemented
 */
BOOL
WINAPI
UnrealizeObject(HGDIOBJ  hgdiobj)
{
    BOOL retValue = TRUE;
    /*
       Win 2k Graphics API, Black Book. by coriolis.com
       Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm)
       and Windows 2000(tm).

       Step 5. UnrealizeObject(hTrackBrush);
     */
    /*
        msdn.microsoft.com,
        "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing,
        and the function returns TRUE. Use SetBrushOrgEx to set the origin of
        a brush."
     */
    if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH)
    {
        retValue = NtGdiUnrealizeObject(hgdiobj);
    }

    return retValue;
}
示例#2
0
HBRUSH FASTCALL
DefWndControlColor(HDC hDC, UINT ctlType)
{
  if (ctlType == CTLCOLOR_SCROLLBAR)
  {
      HBRUSH hb = IntGetSysColorBrush(COLOR_SCROLLBAR);
      COLORREF bk = IntGetSysColor(COLOR_3DHILIGHT);
      IntGdiSetTextColor(hDC, IntGetSysColor(COLOR_3DFACE));
      IntGdiSetBkColor(hDC, bk);

      /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
       * we better use 0x55aa bitmap brush to make scrollbar's background
       * look different from the window background.
       */
      if ( bk == IntGetSysColor(COLOR_WINDOW))
          return gpsi->hbrGray;

      NtGdiUnrealizeObject( hb );
      return hb;
  }

  IntGdiSetTextColor(hDC, IntGetSysColor(COLOR_WINDOWTEXT));

  if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
  {
      IntGdiSetBkColor(hDC, IntGetSysColor(COLOR_WINDOW));
  }
  else
  {
      IntGdiSetBkColor(hDC, IntGetSysColor(COLOR_3DFACE));
      return IntGetSysColorBrush(COLOR_3DFACE);
  }

  return IntGetSysColorBrush(COLOR_WINDOW);
}