Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * System metrics functions |
| 3 | * |
| 4 | * Copyright 1994 Alexandre Julliard |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 5 | * |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 19 | */ |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 20 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 21 | #include <stdio.h> |
Dmitry Timoshkov | a57befe | 2001-06-14 19:24:02 +0000 | [diff] [blame] | 22 | #include <stdlib.h> |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 23 | #include <assert.h> |
Patrik Stridvall | fdcfdb9 | 1999-06-12 14:55:11 +0000 | [diff] [blame] | 24 | |
Jeremy White | d3e22d9 | 2000-02-10 19:03:02 +0000 | [diff] [blame] | 25 | #include "windef.h" |
| 26 | #include "wingdi.h" |
Patrik Stridvall | fdcfdb9 | 1999-06-12 14:55:11 +0000 | [diff] [blame] | 27 | #include "wine/winuser16.h" |
Marcus Meissner | 317af32 | 1999-02-17 13:51:06 +0000 | [diff] [blame] | 28 | #include "winbase.h" |
Dmitry Timoshkov | a57befe | 2001-06-14 19:24:02 +0000 | [diff] [blame] | 29 | #include "winreg.h" |
Marcus Meissner | 317af32 | 1999-02-17 13:51:06 +0000 | [diff] [blame] | 30 | #include "winuser.h" |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 31 | #include "winerror.h" |
Alexandre Julliard | a41b2cf | 2001-01-15 20:12:55 +0000 | [diff] [blame] | 32 | #include "user.h" |
Patrik Stridvall | 1ed4ecf | 1999-06-26 14:58:24 +0000 | [diff] [blame] | 33 | #include "sysmetrics.h" |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 34 | |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 35 | static int sysMetrics[SM_WINE_CMETRICS+1]; |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 36 | |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 37 | |
| 38 | /*********************************************************************** |
| 39 | * RegistryTwips2Pixels |
| 40 | * |
| 41 | * Convert a a dimension value that was obtained from the registry. These are |
| 42 | * quoted as being "twips" values if negative and pixels if positive. |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 43 | * See for example |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 44 | * MSDN Library - April 2001 -> Resource Kits -> |
| 45 | * Windows 2000 Resource Kit Reference -> |
| 46 | * Technical Reference to the Windows 2000 Registry -> |
| 47 | * HKEY_CURRENT_USE -> Control Panel -> Desktop -> WindowMetrics |
| 48 | * |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 49 | * This is written as a function to prevent repeated evaluation of the |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 50 | * argument. |
| 51 | */ |
| 52 | inline static int RegistryTwips2Pixels(int x) |
Dmitry Timoshkov | a57befe | 2001-06-14 19:24:02 +0000 | [diff] [blame] | 53 | { |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 54 | if (x < 0) |
| 55 | x = (-x+7)/15; |
| 56 | return x; |
Dmitry Timoshkov | a57befe | 2001-06-14 19:24:02 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 59 | |
| 60 | /*********************************************************************** |
| 61 | * SYSMETRICS_GetRegistryMetric |
| 62 | * |
| 63 | * Get a registry entry from the already open key. This allows us to open the |
| 64 | * section once and read several values. |
| 65 | * |
| 66 | * Of course this function belongs somewhere more usable but here will do |
| 67 | * for now. |
| 68 | */ |
| 69 | static int SYSMETRICS_GetRegistryMetric ( |
| 70 | HKEY hkey, /* handle to the registry section */ |
| 71 | const char *key, /* value name in the section */ |
| 72 | int default_value) /* default to return */ |
| 73 | { |
| 74 | int value = default_value; |
| 75 | if (hkey) |
| 76 | { |
| 77 | BYTE buffer[128]; |
| 78 | DWORD type, count = sizeof(buffer); |
| 79 | if(!RegQueryValueExA (hkey, key, 0, &type, buffer, &count)) |
| 80 | { |
| 81 | if (type != REG_SZ) |
| 82 | { |
| 83 | /* Are there any utilities for converting registry entries |
| 84 | * between formats? |
| 85 | */ |
| 86 | /* FIXME_(reg)("We need reg format converter\n"); */ |
| 87 | } |
| 88 | else |
| 89 | value = atoi(buffer); |
| 90 | } |
| 91 | } |
| 92 | return RegistryTwips2Pixels(value); |
| 93 | } |
| 94 | |
| 95 | |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 96 | /*********************************************************************** |
| 97 | * SYSMETRICS_Init |
| 98 | * |
| 99 | * Initialisation of the system metrics array. |
Alexandre Julliard | 638f169 | 1999-01-17 16:32:32 +0000 | [diff] [blame] | 100 | * |
| 101 | * Differences in return values between 3.1 and 95 apps under Win95 (FIXME ?): |
Ron Cemer | 16dbfe9 | 1999-06-06 17:14:24 +0000 | [diff] [blame] | 102 | * SM_CXVSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer |
| 103 | * SM_CYHSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer |
| 104 | * SM_CXDLGFRAME x-1 x Already fixed |
| 105 | * SM_CYDLGFRAME x-1 x Already fixed |
| 106 | * SM_CYCAPTION x+1 x Fixed May 24, 1999 - Ronald B. Cemer |
| 107 | * SM_CYMENU x-1 x Already fixed |
Alexandre Julliard | 638f169 | 1999-01-17 16:32:32 +0000 | [diff] [blame] | 108 | * SM_CYFULLSCREEN x-1 x |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 109 | * SM_CXFRAME Fixed July 6, 2001 - Bill Medland |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 110 | * |
Alexandre Julliard | 638f169 | 1999-01-17 16:32:32 +0000 | [diff] [blame] | 111 | * (collides with TWEAK_WineLook sometimes, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 112 | * so changing anything might be difficult) |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 113 | * |
| 114 | * Starting at Win95 there are now a large number or Registry entries in the |
| 115 | * [WindowMetrics] section that are probably relevant here. |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 116 | */ |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 117 | void SYSMETRICS_Init(void) |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 118 | { |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 119 | HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL ); |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 120 | HKEY hkey; /* key to the window metrics area of the registry */ |
Andriy Palamarchuk | c9228e1 | 2001-11-07 20:24:29 +0000 | [diff] [blame] | 121 | INT dummy; |
| 122 | |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 123 | assert(hdc); |
| 124 | |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 125 | if (RegOpenKeyExA (HKEY_CURRENT_USER, "Control Panel\\desktop\\WindowMetrics", |
| 126 | 0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS) hkey = 0; |
| 127 | |
| 128 | if (TWEAK_WineLook > WIN31_LOOK) |
| 129 | { |
| 130 | sysMetrics[SM_CXVSCROLL] = SYSMETRICS_GetRegistryMetric( hkey, "ScrollWidth", 16 ); |
| 131 | sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; |
| 132 | |
| 133 | /* The Win 2000 resource kit SAYS that this is governed by the ScrollHeight |
| 134 | * but on my computer that controls the CYV/CXH values. */ |
| 135 | sysMetrics[SM_CYCAPTION] = SYSMETRICS_GetRegistryMetric(hkey, "CaptionHeight", 18) |
| 136 | + 1; /* for the separator? */ |
| 137 | |
| 138 | sysMetrics[SM_CYMENU] = SYSMETRICS_GetRegistryMetric (hkey, "MenuHeight", 18) + 1; |
| 139 | |
| 140 | |
| 141 | sysMetrics[SM_CXDLGFRAME] = 3; |
| 142 | sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; |
| 143 | |
Andriy Palamarchuk | c9228e1 | 2001-11-07 20:24:29 +0000 | [diff] [blame] | 144 | /* force setting of SM_CXFRAME/SM_CYFRAME */ |
| 145 | SystemParametersInfoA( SPI_GETBORDER, 0, &dummy, 0 ); |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 146 | } |
| 147 | else |
| 148 | { |
| 149 | sysMetrics[SM_CXVSCROLL] = 17; |
| 150 | sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; |
| 151 | sysMetrics[SM_CYCAPTION] = 20; |
| 152 | sysMetrics[SM_CYMENU] = 18; |
| 153 | sysMetrics[SM_CXDLGFRAME] = 4; |
| 154 | sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; |
| 155 | sysMetrics[SM_CXFRAME] = GetProfileIntA("Windows", "BorderWidth", 4) + 1; |
| 156 | sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME]; |
| 157 | } |
| 158 | |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 159 | sysMetrics[SM_CXCURSOR] = 32; |
| 160 | sysMetrics[SM_CYCURSOR] = 32; |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 161 | sysMetrics[SM_CXSCREEN] = GetDeviceCaps( hdc, HORZRES ); |
| 162 | sysMetrics[SM_CYSCREEN] = GetDeviceCaps( hdc, VERTRES ); |
| 163 | sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL ); |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 164 | sysMetrics[SM_CXBORDER] = 1; |
| 165 | sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER]; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 166 | sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1; |
| 167 | sysMetrics[SM_CXHTHUMB] = sysMetrics[SM_CYVTHUMB]; |
| 168 | sysMetrics[SM_CXICON] = 32; |
| 169 | sysMetrics[SM_CYICON] = 32; |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 170 | sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN]; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 171 | sysMetrics[SM_CYFULLSCREEN] = |
| 172 | sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION]; |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 173 | sysMetrics[SM_CYKANJIWINDOW] = 0; |
| 174 | sysMetrics[SM_MOUSEPRESENT] = 1; |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 175 | sysMetrics[SM_CYVSCROLL] = SYSMETRICS_GetRegistryMetric (hkey, "ScrollHeight", sysMetrics[SM_CXVSCROLL]); |
| 176 | sysMetrics[SM_CXHSCROLL] = SYSMETRICS_GetRegistryMetric (hkey, "ScrollHeight", sysMetrics[SM_CYHSCROLL]); |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 177 | sysMetrics[SM_DEBUG] = 0; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 178 | |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 179 | sysMetrics[SM_SWAPBUTTON] = 0; |
Andriy Palamarchuk | d3212f9 | 2001-12-21 20:31:24 +0000 | [diff] [blame] | 180 | sysMetrics[SM_SWAPBUTTON] = SYSPARAMS_GetMouseButtonSwap(); |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 181 | |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 182 | sysMetrics[SM_RESERVED1] = 0; |
| 183 | sysMetrics[SM_RESERVED2] = 0; |
| 184 | sysMetrics[SM_RESERVED3] = 0; |
| 185 | sysMetrics[SM_RESERVED4] = 0; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 186 | |
| 187 | /* FIXME: The following two are calculated, but how? */ |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 188 | sysMetrics[SM_CXMIN] = (TWEAK_WineLook > WIN31_LOOK) ? 112 : 100; |
| 189 | sysMetrics[SM_CYMIN] = (TWEAK_WineLook > WIN31_LOOK) ? 27 : 28; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 190 | |
Dmitry Timoshkov | b1f2325 | 2002-08-28 00:54:53 +0000 | [diff] [blame] | 191 | sysMetrics[SM_CXSIZE] = sysMetrics[SM_CYCAPTION] - 1; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 192 | sysMetrics[SM_CYSIZE] = sysMetrics[SM_CXSIZE]; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 193 | sysMetrics[SM_CXMINTRACK] = sysMetrics[SM_CXMIN]; |
| 194 | sysMetrics[SM_CYMINTRACK] = sysMetrics[SM_CYMIN]; |
Andriy Palamarchuk | 2489dc9 | 2001-12-06 22:28:43 +0000 | [diff] [blame] | 195 | |
| 196 | sysMetrics[SM_CXDOUBLECLK] = 4; |
| 197 | sysMetrics[SM_CYDOUBLECLK] = 4; |
| 198 | SYSPARAMS_GetDoubleClickSize( &sysMetrics[SM_CXDOUBLECLK], &sysMetrics[SM_CYDOUBLECLK] ); |
Andriy Palamarchuk | 67fab90 | 2001-11-09 20:02:41 +0000 | [diff] [blame] | 199 | |
| 200 | sysMetrics[SM_CXICONSPACING] = 75; |
| 201 | SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, |
| 202 | &sysMetrics[SM_CXICONSPACING], 0 ); |
| 203 | sysMetrics[SM_CYICONSPACING] = 75; |
| 204 | SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, |
| 205 | &sysMetrics[SM_CYICONSPACING], 0 ); |
| 206 | |
Andriy Palamarchuk | 2489dc9 | 2001-12-06 22:28:43 +0000 | [diff] [blame] | 207 | SystemParametersInfoA( SPI_GETMENUDROPALIGNMENT, 0, |
| 208 | &sysMetrics[SM_MENUDROPALIGNMENT], 0 ); |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 209 | sysMetrics[SM_PENWINDOWS] = 0; |
| 210 | sysMetrics[SM_DBCSENABLED] = 0; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 211 | |
| 212 | /* FIXME: Need to query X for the following */ |
| 213 | sysMetrics[SM_CMOUSEBUTTONS] = 3; |
| 214 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 215 | sysMetrics[SM_SECURE] = 0; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 216 | sysMetrics[SM_CXEDGE] = sysMetrics[SM_CXBORDER] + 1; |
| 217 | sysMetrics[SM_CYEDGE] = sysMetrics[SM_CXEDGE]; |
| 218 | sysMetrics[SM_CXMINSPACING] = 160; |
| 219 | sysMetrics[SM_CYMINSPACING] = 24; |
Abey George | 967ec70 | 1999-06-26 11:44:18 +0000 | [diff] [blame] | 220 | sysMetrics[SM_CXSMICON] = sysMetrics[SM_CYSIZE] - (sysMetrics[SM_CYSIZE] % 2); |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 221 | sysMetrics[SM_CYSMICON] = sysMetrics[SM_CXSMICON]; |
| 222 | sysMetrics[SM_CYSMCAPTION] = 16; |
| 223 | sysMetrics[SM_CXSMSIZE] = 15; |
| 224 | sysMetrics[SM_CYSMSIZE] = sysMetrics[SM_CXSMSIZE]; |
Dmitry Timoshkov | b1f2325 | 2002-08-28 00:54:53 +0000 | [diff] [blame] | 225 | sysMetrics[SM_CXMENUSIZE] = sysMetrics[SM_CYMENU] - 1; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 226 | sysMetrics[SM_CYMENUSIZE] = sysMetrics[SM_CXMENUSIZE]; |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 227 | |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 228 | /* FIXME: What do these mean? */ |
Francois Gouget | 58f8f12 | 2000-11-15 22:12:35 +0000 | [diff] [blame] | 229 | sysMetrics[SM_ARRANGE] = ARW_HIDE; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 230 | sysMetrics[SM_CXMINIMIZED] = 160; |
| 231 | sysMetrics[SM_CYMINIMIZED] = 24; |
| 232 | |
| 233 | /* FIXME: How do I calculate these? */ |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 234 | sysMetrics[SM_CXMAXTRACK] = |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 235 | sysMetrics[SM_CXSCREEN] + 4 + 2 * sysMetrics[SM_CXFRAME]; |
| 236 | sysMetrics[SM_CYMAXTRACK] = |
| 237 | sysMetrics[SM_CYSCREEN] + 4 + 2 * sysMetrics[SM_CYFRAME]; |
| 238 | sysMetrics[SM_CXMAXIMIZED] = |
| 239 | sysMetrics[SM_CXSCREEN] + 2 * sysMetrics[SM_CXFRAME]; |
| 240 | sysMetrics[SM_CYMAXIMIZED] = |
| 241 | sysMetrics[SM_CYSCREEN] - 45; |
| 242 | sysMetrics[SM_NETWORK] = 3; |
| 243 | |
| 244 | /* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */ |
| 245 | sysMetrics[SM_CLEANBOOT] = 0; |
| 246 | |
Alexandre Julliard | f90efa9 | 1998-06-14 15:24:15 +0000 | [diff] [blame] | 247 | sysMetrics[SM_CXDRAG] = 2; |
| 248 | sysMetrics[SM_CYDRAG] = 2; |
Alexandre Julliard | c1d35cc | 2001-01-24 19:47:57 +0000 | [diff] [blame] | 249 | sysMetrics[SM_CXMENUCHECK] = 14; |
| 250 | sysMetrics[SM_CYMENUCHECK] = 14; |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 251 | |
| 252 | /* FIXME: Should check the type of processor for the following */ |
| 253 | sysMetrics[SM_SLOWMACHINE] = 0; |
| 254 | |
| 255 | /* FIXME: Should perform a check */ |
| 256 | sysMetrics[SM_MIDEASTENABLED] = 0; |
| 257 | |
| 258 | sysMetrics[SM_MOUSEWHEELPRESENT] = 0; |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 259 | |
Alexandre Julliard | d30dfd2 | 1998-09-27 18:28:36 +0000 | [diff] [blame] | 260 | sysMetrics[SM_CXVIRTUALSCREEN] = sysMetrics[SM_CXSCREEN]; |
| 261 | sysMetrics[SM_CYVIRTUALSCREEN] = sysMetrics[SM_CYSCREEN]; |
| 262 | sysMetrics[SM_XVIRTUALSCREEN] = 0; |
| 263 | sysMetrics[SM_YVIRTUALSCREEN] = 0; |
| 264 | sysMetrics[SM_CMONITORS] = 1; |
| 265 | sysMetrics[SM_SAMEDISPLAYFORMAT] = 1; |
Alexandre Julliard | 902da69 | 1995-11-05 14:39:02 +0000 | [diff] [blame] | 266 | sysMetrics[SM_CMETRICS] = SM_CMETRICS; |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 267 | |
Andriy Palamarchuk | 67fab90 | 2001-11-09 20:02:41 +0000 | [diff] [blame] | 268 | SystemParametersInfoA( SPI_GETSHOWSOUNDS, 0, &sysMetrics[SM_SHOWSOUNDS], 0 ); |
Andriy Palamarchuk | c9228e1 | 2001-11-07 20:24:29 +0000 | [diff] [blame] | 269 | |
Bill Medland | fb57c59 | 2001-07-11 20:18:11 +0000 | [diff] [blame] | 270 | if (hkey) RegCloseKey (hkey); |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 271 | DeleteDC( hdc ); |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | |
| 275 | /*********************************************************************** |
Andriy Palamarchuk | 676eb23 | 2001-10-02 18:35:32 +0000 | [diff] [blame] | 276 | * SYSMETRICS_Set |
| 277 | * |
| 278 | * Sets system metrics. |
| 279 | */ |
| 280 | INT SYSMETRICS_Set( INT index, INT value ) |
| 281 | { |
| 282 | if ((index < 0) || (index > SM_WINE_CMETRICS)) return 0; |
| 283 | else |
| 284 | { |
| 285 | INT prev = sysMetrics[index]; |
| 286 | sysMetrics[index] = value; |
| 287 | return prev; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | |
| 292 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 293 | * GetSystemMetrics (USER.179) |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 294 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 295 | INT16 WINAPI GetSystemMetrics16( INT16 index ) |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 296 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 297 | return (INT16)GetSystemMetrics(index); |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | |
| 301 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 302 | * GetSystemMetrics (USER32.@) |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 303 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 304 | INT WINAPI GetSystemMetrics( INT index ) |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 305 | { |
Alexandre Julliard | 646c562 | 2000-07-31 23:32:47 +0000 | [diff] [blame] | 306 | if ((index < 0) || (index > SM_WINE_CMETRICS)) return 0; |
Andriy Palamarchuk | 676eb23 | 2001-10-02 18:35:32 +0000 | [diff] [blame] | 307 | return sysMetrics[index]; |
Alexandre Julliard | cdd0923 | 1994-01-12 11:12:51 +0000 | [diff] [blame] | 308 | } |