2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * PURPOSE: Window classes
24 * FILE: subsys/win32k/ntuser/metric.c
25 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
27 * 06-06-2001 CSH Created
30 /* INCLUDES ******************************************************************/
32 #include <ddk/ntddk.h>
33 #include <win32k/win32k.h>
34 #include <win32k/userobj.h>
35 #include <include/class.h>
36 #include <include/error.h>
37 #include <include/winsta.h>
38 #include <include/msgqueue.h>
39 #include <include/window.h>
44 /* FUNCTIONS *****************************************************************/
46 /* FIXME: Alot of thse values should NOT be hardcoded but they are */
48 NtUserGetSystemMetrics(ULONG Index)
51 PWINSTATION_OBJECT WinStaObject;
52 PWINDOW_OBJECT DesktopWindow;
53 ULONG Width, Height, Result;
62 case SM_CMOUSEBUTTONS:
76 Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
80 if (!NT_SUCCESS(Status))
86 Result = WinStaObject->SystemCursor.DblClickWidth;
89 Result = WinStaObject->SystemCursor.DblClickWidth;
92 Result = (UINT)WinStaObject->SystemCursor.SwapButtons;
96 ObDereferenceObject(WinStaObject);
108 case SM_CXFULLSCREEN:
109 /* FIXME: shouldn't we take borders etc into account??? */
110 return NtUserGetSystemMetrics(SM_CXSCREEN);
111 case SM_CYFULLSCREEN:
112 return NtUserGetSystemMetrics(SM_CYSCREEN);
122 case SM_CXICONSPACING:
123 case SM_CYICONSPACING:
126 return(NtUserGetSystemMetrics(SM_CXSCREEN) + 8); /* This seems to be 8
130 return(NtUserGetSystemMetrics(SM_CYSCREEN) - 20); /* This seems to be 20
135 return(NtUserGetSystemMetrics(SM_CYSCREEN) + 12);
137 return(NtUserGetSystemMetrics(SM_CYSCREEN) + 12);
152 case SM_CXMINSPACING:
154 case SM_CYMINSPACING:
162 DesktopWindow = IntGetWindowObject(IntGetDesktopWindow());
163 if (NULL != DesktopWindow)
165 Width = DesktopWindow->WindowRect.right;
166 Height = DesktopWindow->WindowRect.bottom;
173 IntReleaseWindowObject(DesktopWindow);
174 return SM_CXSCREEN == Index ? Width : Height;
190 case SM_CYKANJIWINDOW:
198 case SM_MENUDROPALIGNMENT:
199 case SM_MIDEASTENABLED:
201 case SM_MOUSEPRESENT: