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 ******************************************************************/
37 /* FUNCTIONS *****************************************************************/
39 /* FIXME: Alot of thse values should NOT be hardcoded but they are */
41 UserGetSystemMetrics(ULONG Index
)
44 PWINSTATION_OBJECT WinStaObject
;
45 ULONG Width
, Height
, Result
;
54 case SM_CMOUSEBUTTONS
:
69 PSYSTEM_CURSORINFO CurInfo
;
70 Status
= IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation
,
74 if (!NT_SUCCESS(Status
))
77 CurInfo
= IntGetSysCursorInfo(WinStaObject
);
81 Result
= CurInfo
->DblClickWidth
;
84 Result
= CurInfo
->DblClickWidth
;
87 Result
= (UINT
)CurInfo
->SwapButtons
;
91 ObDereferenceObject(WinStaObject
);
104 case SM_CXFULLSCREEN
:
105 /* FIXME: shouldn't we take borders etc into account??? */
106 return UserGetSystemMetrics(SM_CXSCREEN
);
107 case SM_CYFULLSCREEN
:
108 return UserGetSystemMetrics(SM_CYSCREEN
);
118 case SM_CXICONSPACING
:
119 case SM_CYICONSPACING
:
122 return(UserGetSystemMetrics(SM_CXSCREEN
) + 8); /* This seems to be 8
126 return(UserGetSystemMetrics(SM_CYSCREEN
) - 20); /* This seems to be 20
131 return(UserGetSystemMetrics(SM_CYSCREEN
) + 12);
133 return(UserGetSystemMetrics(SM_CYSCREEN
) + 12);
148 case SM_CXMINSPACING
:
150 case SM_CYMINSPACING
:
164 ScreenDCHandle
= IntGdiCreateDC(NULL
, NULL
, NULL
, NULL
, TRUE
);
165 if (NULL
!= ScreenDCHandle
)
167 ScreenDC
= DC_LockDc(ScreenDCHandle
);
168 if (NULL
!= ScreenDC
)
170 Width
= ScreenDC
->GDIInfo
->ulHorzRes
;
171 Height
= ScreenDC
->GDIInfo
->ulVertRes
;
172 DC_UnlockDc(ScreenDC
);
174 NtGdiDeleteDC(ScreenDCHandle
);
176 return SM_CXSCREEN
== Index
? Width
: Height
;
193 case SM_CYKANJIWINDOW
:
201 case SM_MENUDROPALIGNMENT
:
202 case SM_MIDEASTENABLED
:
204 case SM_MOUSEPRESENT
:
223 /* FIXME: Alot of thse values should NOT be hardcoded but they are */
225 NtUserGetSystemMetrics(ULONG Index
)
227 DECLARE_RETURN(ULONG
);
229 DPRINT("Enter NtUserGetSystemMetrics\n");
232 RETURN(UserGetSystemMetrics(Index
));
235 DPRINT("Leave NtUserGetSystemMetrics, ret=%i\n",_ret_
);