Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4a9b22b2
Commit
4a9b22b2
authored
Dec 09, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged system metrics support into sysparams.c, and moved that file to
the dlls/user directory.
parent
f238cd88
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
252 additions
and
385 deletions
+252
-385
Makefile.in
dlls/user/Makefile.in
+1
-2
sysparams.c
dlls/user/sysparams.c
+249
-89
user_main.c
dlls/user/user_main.c
+1
-2
user_private.h
dlls/user/user_private.h
+1
-2
sysmetrics.c
windows/sysmetrics.c
+0
-290
No files found.
dlls/user/Makefile.in
View file @
4a9b22b2
...
@@ -34,8 +34,6 @@ C_SRCS = \
...
@@ -34,8 +34,6 @@ C_SRCS = \
$(TOPOBJDIR)
/windows/scroll.c
\
$(TOPOBJDIR)
/windows/scroll.c
\
$(TOPOBJDIR)
/windows/spy.c
\
$(TOPOBJDIR)
/windows/spy.c
\
$(TOPOBJDIR)
/windows/syscolor.c
\
$(TOPOBJDIR)
/windows/syscolor.c
\
$(TOPOBJDIR)
/windows/sysmetrics.c
\
$(TOPOBJDIR)
/windows/sysparams.c
\
$(TOPOBJDIR)
/windows/user.c
\
$(TOPOBJDIR)
/windows/user.c
\
$(TOPOBJDIR)
/windows/win.c
\
$(TOPOBJDIR)
/windows/win.c
\
$(TOPOBJDIR)
/windows/winhelp.c
\
$(TOPOBJDIR)
/windows/winhelp.c
\
...
@@ -66,6 +64,7 @@ C_SRCS = \
...
@@ -66,6 +64,7 @@ C_SRCS = \
resource.c
\
resource.c
\
scroll.c
\
scroll.c
\
static.c
\
static.c
\
sysparams.c
\
text.c
\
text.c
\
uitools.c
\
uitools.c
\
user_main.c
\
user_main.c
\
...
...
windows
/sysparams.c
→
dlls/user
/sysparams.c
View file @
4a9b22b2
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -191,6 +192,8 @@ static char spi_loaded[SPI_WINE_IDX + 1];
...
@@ -191,6 +192,8 @@ static char spi_loaded[SPI_WINE_IDX + 1];
static
BOOL
notify_change
=
TRUE
;
static
BOOL
notify_change
=
TRUE
;
/* System parameters storage */
/* System parameters storage */
static
int
sysMetrics
[
SM_CMETRICS
+
1
];
static
HDC
display_dc
;
static
BOOL
beep_active
=
TRUE
;
static
BOOL
beep_active
=
TRUE
;
static
int
mouse_threshold1
=
6
;
static
int
mouse_threshold1
=
6
;
static
int
mouse_threshold2
=
10
;
static
int
mouse_threshold2
=
10
;
...
@@ -502,92 +505,214 @@ static BOOL SYSPARAMS_Save( LPCWSTR lpRegKey, LPCWSTR lpValName, LPCWSTR lpValue
...
@@ -502,92 +505,214 @@ static BOOL SYSPARAMS_Save( LPCWSTR lpRegKey, LPCWSTR lpValName, LPCWSTR lpValue
/***********************************************************************
/***********************************************************************
*
SYSPARAMS_GetDoubleClickSize
*
SYSPARAMS_Twips2Pixels
*
*
* There is no SPI_GETDOUBLECLK* so we export this function instead.
* Convert a dimension value that was obtained from the registry. These are
* quoted as being "twips" values if negative and pixels if positive.
* See for example
* MSDN Library - April 2001 -> Resource Kits ->
* Windows 2000 Resource Kit Reference ->
* Technical Reference to the Windows 2000 Registry ->
* HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics
*/
*/
void
SYSPARAMS_GetDoubleClickSize
(
INT
*
width
,
INT
*
height
)
inline
static
int
SYSPARAMS_Twips2Pixels
(
int
x
)
{
{
WCHAR
buf
[
10
];
if
(
x
<
0
)
x
=
(
-
x
+
7
)
/
15
;
return
x
;
}
if
(
!
spi_loaded
[
SPI_SETDOUBLECLKWIDTH_IDX
])
/***********************************************************************
{
* SYSPARAMS_GetRegistryMetric
if
(
SYSPARAMS_Load
(
SPI_SETDOUBLECLKWIDTH_REGKEY1
,
*
SPI_SETDOUBLECLKWIDTH_VALNAME
,
buf
,
sizeof
(
buf
)
))
* Get a registry entry from the already open key. This allows us to open the
* section once and read several values.
*
* Of course this function belongs somewhere more usable but here will do
* for now.
*/
static
int
SYSPARAMS_GetRegistryMetric
(
HKEY
hkey
,
/* handle to the registry section */
const
char
*
key
,
/* value name in the section */
int
default_value
)
/* default to return */
{
int
value
=
default_value
;
if
(
hkey
)
{
{
SYSMETRICS_Set
(
SM_CXDOUBLECLK
,
atoiW
(
buf
)
);
BYTE
buffer
[
128
];
}
DWORD
type
,
count
=
sizeof
(
buffer
);
spi_loaded
[
SPI_SETDOUBLECLKWIDTH_IDX
]
=
TRUE
;
if
(
!
RegQueryValueExA
(
hkey
,
key
,
0
,
&
type
,
buffer
,
&
count
))
}
if
(
!
spi_loaded
[
SPI_SETDOUBLECLKHEIGHT_IDX
])
{
{
if
(
SYSPARAMS_Load
(
SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
if
(
type
!=
REG_SZ
)
SPI_SETDOUBLECLKHEIGHT_VALNAME
,
buf
,
sizeof
(
buf
)
))
{
{
SYSMETRICS_Set
(
SM_CYDOUBLECLK
,
atoiW
(
buf
)
);
/* Are there any utilities for converting registry entries
* between formats?
*/
/* FIXME_(reg)("We need reg format converter\n"); */
}
else
value
=
atoi
(
buffer
);
}
}
spi_loaded
[
SPI_SETDOUBLECLKHEIGHT_IDX
]
=
TRUE
;
}
}
*
width
=
GetSystemMetrics
(
SM_CXDOUBLECLK
);
return
SYSPARAMS_Twips2Pixels
(
value
);
*
height
=
GetSystemMetrics
(
SM_CYDOUBLECLK
);
}
}
/***********************************************************************
/***********************************************************************
* SYSPARAMS_GetMouseButtonSwap
* SYSPARAMS_Init
*
* Initialisation of the system metrics array.
*
* Differences in return values between 3.1 and 95 apps under Win95 (FIXME ?):
* SM_CXVSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CYHSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CXDLGFRAME x-1 x Already fixed
* SM_CYDLGFRAME x-1 x Already fixed
* SM_CYCAPTION x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CYMENU x-1 x Already fixed
* SM_CYFULLSCREEN x-1 x
* SM_CXFRAME Fixed July 6, 2001 - Bill Medland
*
*
* There is no SPI_GETMOUSEBUTTONSWAP so we export this function instead.
* Starting at Win95 there are now a large number or Registry entries in the
* [WindowMetrics] section that are probably relevant here.
*/
*/
INT
SYSPARAMS_GetMouseButtonSwap
(
void
)
void
SYSPARAMS_Init
(
void
)
{
{
int
spi_idx
=
SPI_SETMOUSEBUTTONSWAP_IDX
;
HKEY
hkey
;
/* key to the window metrics area of the registry */
WCHAR
buf
[
10
];
INT
border
;
display_dc
=
CreateICA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
assert
(
display_dc
);
if
(
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
"Control Panel
\\
desktop
\\
WindowMetrics"
,
0
,
KEY_QUERY_VALUE
,
&
hkey
)
!=
ERROR_SUCCESS
)
hkey
=
0
;
sysMetrics
[
SM_CXVSCROLL
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"ScrollWidth"
,
16
);
sysMetrics
[
SM_CYHSCROLL
]
=
sysMetrics
[
SM_CXVSCROLL
];
/* The Win 2000 resource kit SAYS that this is governed by the ScrollHeight
* but on my computer that controls the CYV/CXH values. */
sysMetrics
[
SM_CYCAPTION
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"CaptionHeight"
,
18
)
+
1
;
/* for the separator? */
sysMetrics
[
SM_CYMENU
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"MenuHeight"
,
18
)
+
1
;
sysMetrics
[
SM_CXDLGFRAME
]
=
3
;
sysMetrics
[
SM_CYDLGFRAME
]
=
sysMetrics
[
SM_CXDLGFRAME
];
SystemParametersInfoA
(
SPI_GETBORDER
,
0
,
&
border
,
0
);
sysMetrics
[
SM_CXFRAME
]
=
sysMetrics
[
SM_CXDLGFRAME
]
+
border
;
sysMetrics
[
SM_CYFRAME
]
=
sysMetrics
[
SM_CYDLGFRAME
]
+
border
;
sysMetrics
[
SM_CXCURSOR
]
=
32
;
sysMetrics
[
SM_CYCURSOR
]
=
32
;
sysMetrics
[
SM_CXBORDER
]
=
1
;
sysMetrics
[
SM_CYBORDER
]
=
sysMetrics
[
SM_CXBORDER
];
sysMetrics
[
SM_CYVTHUMB
]
=
sysMetrics
[
SM_CXVSCROLL
];
sysMetrics
[
SM_CXHTHUMB
]
=
sysMetrics
[
SM_CYVTHUMB
];
sysMetrics
[
SM_CXICON
]
=
32
;
sysMetrics
[
SM_CYICON
]
=
32
;
sysMetrics
[
SM_CYKANJIWINDOW
]
=
0
;
sysMetrics
[
SM_MOUSEPRESENT
]
=
1
;
sysMetrics
[
SM_CYVSCROLL
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"ScrollHeight"
,
sysMetrics
[
SM_CXVSCROLL
]);
sysMetrics
[
SM_CXHSCROLL
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"ScrollHeight"
,
sysMetrics
[
SM_CYHSCROLL
]);
sysMetrics
[
SM_DEBUG
]
=
0
;
sysMetrics
[
SM_SWAPBUTTON
]
=
0
;
if
(
SYSPARAMS_Load
(
SPI_SETMOUSEBUTTONSWAP_REGKEY
,
SPI_SETMOUSEBUTTONSWAP_VALNAME
,
buf
,
sizeof
(
buf
)
))
sysMetrics
[
SM_SWAPBUTTON
]
=
atoiW
(
buf
);
spi_loaded
[
SPI_SETMOUSEBUTTONSWAP_IDX
]
=
TRUE
;
sysMetrics
[
SM_RESERVED1
]
=
0
;
sysMetrics
[
SM_RESERVED2
]
=
0
;
sysMetrics
[
SM_RESERVED3
]
=
0
;
sysMetrics
[
SM_RESERVED4
]
=
0
;
/* FIXME: The following two are calculated, but how? */
sysMetrics
[
SM_CXMIN
]
=
112
;
sysMetrics
[
SM_CYMIN
]
=
27
;
sysMetrics
[
SM_CXSIZE
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"CaptionWidth"
,
sysMetrics
[
SM_CYCAPTION
]
-
1
);
sysMetrics
[
SM_CYSIZE
]
=
sysMetrics
[
SM_CYCAPTION
]
-
1
;
sysMetrics
[
SM_CXMINTRACK
]
=
sysMetrics
[
SM_CXMIN
];
sysMetrics
[
SM_CYMINTRACK
]
=
sysMetrics
[
SM_CYMIN
];
sysMetrics
[
SM_CXDOUBLECLK
]
=
4
;
sysMetrics
[
SM_CYDOUBLECLK
]
=
4
;
if
(
SYSPARAMS_Load
(
SPI_SETDOUBLECLKWIDTH_REGKEY1
,
SPI_SETDOUBLECLKWIDTH_VALNAME
,
buf
,
sizeof
(
buf
)
))
sysMetrics
[
SM_CXDOUBLECLK
]
=
atoiW
(
buf
);
spi_loaded
[
SPI_SETDOUBLECLKWIDTH_IDX
]
=
TRUE
;
if
(
!
spi_loaded
[
spi_idx
]
)
if
(
SYSPARAMS_Load
(
SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
SPI_SETDOUBLECLKHEIGHT_VALNAME
,
buf
,
sizeof
(
buf
)
)
)
{
sysMetrics
[
SM_CYDOUBLECLK
]
=
atoiW
(
buf
);
WCHAR
buf
[
5
]
;
spi_loaded
[
SPI_SETDOUBLECLKHEIGHT_IDX
]
=
TRUE
;
if
(
SYSPARAMS_Load
(
SPI_SETMOUSEBUTTONSWAP_REGKEY
,
sysMetrics
[
SM_CXICONSPACING
]
=
75
;
SPI_SETMOUSEBUTTONSWAP_VALNAME
,
buf
,
sizeof
(
buf
)
))
SystemParametersInfoA
(
SPI_ICONHORIZONTALSPACING
,
0
,
&
sysMetrics
[
SM_CXICONSPACING
],
0
);
{
sysMetrics
[
SM_CYICONSPACING
]
=
75
;
SYSMETRICS_Set
(
SM_SWAPBUTTON
,
atoiW
(
buf
)
);
SystemParametersInfoA
(
SPI_ICONVERTICALSPACING
,
0
,
&
sysMetrics
[
SM_CYICONSPACING
],
0
);
}
spi_loaded
[
spi_idx
]
=
TRUE
;
}
return
GetSystemMetrics
(
SM_SWAPBUTTON
);
SystemParametersInfoA
(
SPI_GETMENUDROPALIGNMENT
,
0
,
&
sysMetrics
[
SM_MENUDROPALIGNMENT
],
0
);
}
sysMetrics
[
SM_PENWINDOWS
]
=
0
;
sysMetrics
[
SM_DBCSENABLED
]
=
0
;
/***********************************************************************
/* FIXME: Need to query X for the following */
*
sysMetrics
[
SM_CMOUSEBUTTONS
]
=
3
;
* SYSPARAMS_GetGUIFont
*
* fills LOGFONT with 'default GUI font'.
*/
static
void
SYSPARAMS_GetGUIFont
(
LOGFONTW
*
plf
)
sysMetrics
[
SM_SECURE
]
=
0
;
{
sysMetrics
[
SM_CXEDGE
]
=
sysMetrics
[
SM_CXBORDER
]
+
1
;
HFONT
hf
;
sysMetrics
[
SM_CYEDGE
]
=
sysMetrics
[
SM_CXEDGE
];
sysMetrics
[
SM_CXMINSPACING
]
=
160
;
sysMetrics
[
SM_CYMINSPACING
]
=
24
;
sysMetrics
[
SM_CXSMICON
]
=
16
;
sysMetrics
[
SM_CYSMICON
]
=
16
;
sysMetrics
[
SM_CYSMCAPTION
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"SmCaptionHeight"
,
15
)
+
1
;
sysMetrics
[
SM_CXSMSIZE
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"SmCaptionWidth"
,
13
);
sysMetrics
[
SM_CYSMSIZE
]
=
sysMetrics
[
SM_CYSMCAPTION
]
-
1
;
sysMetrics
[
SM_CXMENUSIZE
]
=
SYSPARAMS_GetRegistryMetric
(
hkey
,
"MenuWidth"
,
sysMetrics
[
SM_CYMENU
]
-
1
);
sysMetrics
[
SM_CYMENUSIZE
]
=
sysMetrics
[
SM_CYMENU
]
-
1
;
memset
(
plf
,
0
,
sizeof
(
LOGFONTW
)
);
/* FIXME: What do these mean? */
hf
=
(
HFONT
)
GetStockObject
(
DEFAULT_GUI_FONT
);
sysMetrics
[
SM_ARRANGE
]
=
ARW_HIDE
;
if
(
GetObjectW
(
hf
,
sizeof
(
LOGFONTW
),
plf
)
!=
sizeof
(
LOGFONTW
)
)
sysMetrics
[
SM_CXMINIMIZED
]
=
160
;
{
sysMetrics
[
SM_CYMINIMIZED
]
=
24
;
/*
* GetObjectW() would be succeeded always
* since this is a stock object
*/
ERR
(
"GetObjectW() failed
\n
"
);
}
}
/* copied from GetSystemMetrics()'s RegistryTwips2Pixels() */
/* FIXME: How do I calculate these? */
inline
static
int
SYSPARAMS_Twips2Pixels
(
int
x
)
sysMetrics
[
SM_NETWORK
]
=
3
;
{
if
(
x
<
0
)
/* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
x
=
(
-
x
+
7
)
/
15
;
sysMetrics
[
SM_CLEANBOOT
]
=
0
;
return
x
;
sysMetrics
[
SM_CXDRAG
]
=
4
;
sysMetrics
[
SM_CYDRAG
]
=
4
;
sysMetrics
[
SM_CXMENUCHECK
]
=
13
;
sysMetrics
[
SM_CYMENUCHECK
]
=
13
;
/* FIXME: Should check the type of processor for the following */
sysMetrics
[
SM_SLOWMACHINE
]
=
0
;
/* FIXME: Should perform a check */
sysMetrics
[
SM_MIDEASTENABLED
]
=
0
;
sysMetrics
[
SM_MOUSEWHEELPRESENT
]
=
1
;
sysMetrics
[
SM_XVIRTUALSCREEN
]
=
0
;
sysMetrics
[
SM_YVIRTUALSCREEN
]
=
0
;
sysMetrics
[
SM_CMONITORS
]
=
1
;
sysMetrics
[
SM_SAMEDISPLAYFORMAT
]
=
1
;
sysMetrics
[
SM_CMETRICS
]
=
SM_CMETRICS
;
SystemParametersInfoA
(
SPI_GETSHOWSOUNDS
,
0
,
&
sysMetrics
[
SM_SHOWSOUNDS
],
0
);
if
(
hkey
)
RegCloseKey
(
hkey
);
SYSCOLOR_Init
();
}
}
/***********************************************************************
/***********************************************************************
* SystemParametersInfoW (USER32.@)
* SystemParametersInfoW (USER32.@)
*
*
...
@@ -727,8 +852,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -727,8 +852,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
border
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
border
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
SYSMETRICS_Set
(
SM_CXFRAME
,
border
+
GetSystemMetrics
(
SM_CXDLGFRAME
)
)
;
sysMetrics
[
SM_CXFRAME
]
=
border
+
sysMetrics
[
SM_CXDLGFRAME
]
;
SYSMETRICS_Set
(
SM_CYFRAME
,
border
+
GetSystemMetrics
(
SM_CXDLGFRAME
)
)
;
sysMetrics
[
SM_CYFRAME
]
=
border
+
sysMetrics
[
SM_CYDLGFRAME
]
;
}
}
*
(
INT
*
)
pvParam
=
border
;
*
(
INT
*
)
pvParam
=
border
;
break
;
break
;
...
@@ -747,8 +872,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -747,8 +872,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
{
{
border
=
uiParam
;
border
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
SYSMETRICS_Set
(
SM_CXFRAME
,
uiParam
+
GetSystemMetrics
(
SM_CXDLGFRAME
)
)
;
sysMetrics
[
SM_CXFRAME
]
=
border
+
sysMetrics
[
SM_CXDLGFRAME
]
;
SYSMETRICS_Set
(
SM_CYFRAME
,
uiParam
+
GetSystemMetrics
(
SM_CXDLGFRAME
)
)
;
sysMetrics
[
SM_CYFRAME
]
=
border
+
sysMetrics
[
SM_CYDLGFRAME
]
;
}
}
}
}
else
else
...
@@ -810,12 +935,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -810,12 +935,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_ICONHORIZONTALSPACING_VALNAME
,
buf
,
sizeof
(
buf
)
))
SPI_ICONHORIZONTALSPACING_VALNAME
,
buf
,
sizeof
(
buf
)
))
{
{
val
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
val
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
SYSMETRICS_Set
(
SM_CXICONSPACING
,
val
)
;
sysMetrics
[
SM_CXICONSPACING
]
=
val
;
}
}
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
*
(
INT
*
)
pvParam
=
GetSystemMetrics
(
SM_CXICONSPACING
)
;
*
(
INT
*
)
pvParam
=
sysMetrics
[
SM_CXICONSPACING
]
;
}
}
else
else
{
{
...
@@ -828,7 +953,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -828,7 +953,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_ICONHORIZONTALSPACING_VALNAME
,
SPI_ICONHORIZONTALSPACING_VALNAME
,
buf
,
fWinIni
))
buf
,
fWinIni
))
{
{
SYSMETRICS_Set
(
SM_CXICONSPACING
,
uiParam
)
;
sysMetrics
[
SM_CXICONSPACING
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1005,12 +1130,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1005,12 +1130,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_ICONVERTICALSPACING_VALNAME
,
buf
,
sizeof
(
buf
)
))
SPI_ICONVERTICALSPACING_VALNAME
,
buf
,
sizeof
(
buf
)
))
{
{
val
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
val
=
SYSPARAMS_Twips2Pixels
(
atoiW
(
buf
)
);
SYSMETRICS_Set
(
SM_CYICONSPACING
,
val
)
;
sysMetrics
[
SM_CYICONSPACING
]
=
val
;
}
}
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
*
(
INT
*
)
pvParam
=
GetSystemMetrics
(
SM_CYICONSPACING
)
;
*
(
INT
*
)
pvParam
=
sysMetrics
[
SM_CYICONSPACING
]
;
}
}
else
else
{
{
...
@@ -1023,7 +1148,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1023,7 +1148,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_ICONVERTICALSPACING_VALNAME
,
SPI_ICONVERTICALSPACING_VALNAME
,
buf
,
fWinIni
))
buf
,
fWinIni
))
{
{
SYSMETRICS_Set
(
SM_CYICONSPACING
,
uiParam
)
;
sysMetrics
[
SM_CYICONSPACING
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1082,12 +1207,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1082,12 +1207,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
if
(
SYSPARAMS_Load
(
SPI_SETMENUDROPALIGNMENT_REGKEY1
,
if
(
SYSPARAMS_Load
(
SPI_SETMENUDROPALIGNMENT_REGKEY1
,
SPI_SETMENUDROPALIGNMENT_VALNAME
,
buf
,
sizeof
(
buf
)
))
SPI_SETMENUDROPALIGNMENT_VALNAME
,
buf
,
sizeof
(
buf
)
))
{
{
SYSMETRICS_Set
(
SM_MENUDROPALIGNMENT
,
atoiW
(
buf
)
);
sysMetrics
[
SM_MENUDROPALIGNMENT
]
=
atoiW
(
buf
);
}
}
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
*
(
BOOL
*
)
pvParam
=
GetSystemMetrics
(
SM_MENUDROPALIGNMENT
)
;
*
(
BOOL
*
)
pvParam
=
sysMetrics
[
SM_MENUDROPALIGNMENT
]
;
break
;
break
;
case
SPI_SETMENUDROPALIGNMENT
:
/* 28 */
case
SPI_SETMENUDROPALIGNMENT
:
/* 28 */
...
@@ -1103,7 +1228,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1103,7 +1228,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SYSPARAMS_Save
(
SPI_SETMENUDROPALIGNMENT_REGKEY2
,
SYSPARAMS_Save
(
SPI_SETMENUDROPALIGNMENT_REGKEY2
,
SPI_SETMENUDROPALIGNMENT_VALNAME
,
SPI_SETMENUDROPALIGNMENT_VALNAME
,
buf
,
fWinIni
);
buf
,
fWinIni
);
SYSMETRICS_Set
(
SM_MENUDROPALIGNMENT
,
uiParam
)
;
sysMetrics
[
SM_MENUDROPALIGNMENT
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1124,7 +1249,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1124,7 +1249,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SYSPARAMS_Save
(
SPI_SETDOUBLECLKWIDTH_REGKEY2
,
SYSPARAMS_Save
(
SPI_SETDOUBLECLKWIDTH_REGKEY2
,
SPI_SETDOUBLECLKWIDTH_VALNAME
,
SPI_SETDOUBLECLKWIDTH_VALNAME
,
buf
,
fWinIni
);
buf
,
fWinIni
);
SYSMETRICS_Set
(
SM_CXDOUBLECLK
,
uiParam
)
;
sysMetrics
[
SM_CXDOUBLECLK
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1145,7 +1270,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1145,7 +1270,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SYSPARAMS_Save
(
SPI_SETDOUBLECLKHEIGHT_REGKEY2
,
SYSPARAMS_Save
(
SPI_SETDOUBLECLKHEIGHT_REGKEY2
,
SPI_SETDOUBLECLKHEIGHT_VALNAME
,
SPI_SETDOUBLECLKHEIGHT_VALNAME
,
buf
,
fWinIni
);
buf
,
fWinIni
);
SYSMETRICS_Set
(
SM_CYDOUBLECLK
,
uiParam
)
;
sysMetrics
[
SM_CYDOUBLECLK
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1165,7 +1290,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1165,7 +1290,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
* If a returned font is not a correct font in your environment,
* If a returned font is not a correct font in your environment,
* please try to fix objects/gdiobj.c at first.
* please try to fix objects/gdiobj.c at first.
*/
*/
SYSPARAMS_GetGUIFont
(
&
lfDefault
);
GetObjectW
(
GetStockObject
(
DEFAULT_GUI_FONT
),
sizeof
(
LOGFONTW
),
&
lfDefault
);
GetProfileStringW
(
Desktop
,
IconTitleFaceName
,
GetProfileStringW
(
Desktop
,
IconTitleFaceName
,
lfDefault
.
lfFaceName
,
lfDefault
.
lfFaceName
,
...
@@ -1216,7 +1341,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1216,7 +1341,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_SETMOUSEBUTTONSWAP_VALNAME
,
SPI_SETMOUSEBUTTONSWAP_VALNAME
,
buf
,
fWinIni
))
buf
,
fWinIni
))
{
{
SYSMETRICS_Set
(
SM_SWAPBUTTON
,
uiParam
)
;
sysMetrics
[
SM_SWAPBUTTON
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -1288,20 +1413,20 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1288,20 +1413,20 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
/* initialize geometry entries */
/* initialize geometry entries */
lpnm
->
iBorderWidth
=
1
;
lpnm
->
iBorderWidth
=
1
;
lpnm
->
iScrollWidth
=
GetSystemMetrics
(
SM_CXVSCROLL
)
;
lpnm
->
iScrollWidth
=
sysMetrics
[
SM_CXVSCROLL
]
;
lpnm
->
iScrollHeight
=
GetSystemMetrics
(
SM_CYHSCROLL
)
;
lpnm
->
iScrollHeight
=
sysMetrics
[
SM_CYHSCROLL
]
;
/* size of the normal caption buttons */
/* size of the normal caption buttons */
lpnm
->
iCaptionWidth
=
GetSystemMetrics
(
SM_CXSIZE
)
;
lpnm
->
iCaptionWidth
=
sysMetrics
[
SM_CXSIZE
]
;
lpnm
->
iCaptionHeight
=
GetSystemMetrics
(
SM_CYSIZE
)
;
lpnm
->
iCaptionHeight
=
sysMetrics
[
SM_CYSIZE
]
;
/* caption font metrics */
/* caption font metrics */
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfCaptionFont
),
0
);
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfCaptionFont
),
0
);
lpnm
->
lfCaptionFont
.
lfWeight
=
FW_BOLD
;
lpnm
->
lfCaptionFont
.
lfWeight
=
FW_BOLD
;
/* size of the small caption buttons */
/* size of the small caption buttons */
lpnm
->
iSmCaptionWidth
=
GetSystemMetrics
(
SM_CXSMSIZE
)
;
lpnm
->
iSmCaptionWidth
=
sysMetrics
[
SM_CXSMSIZE
]
;
lpnm
->
iSmCaptionHeight
=
GetSystemMetrics
(
SM_CYSMSIZE
)
;
lpnm
->
iSmCaptionHeight
=
sysMetrics
[
SM_CYSMSIZE
]
;
/* small caption font metrics */
/* small caption font metrics */
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfSmCaptionFont
),
0
);
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfSmCaptionFont
),
0
);
...
@@ -1309,8 +1434,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1309,8 +1434,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
/* menus, FIXME: names of wine.conf entries are bogus */
/* menus, FIXME: names of wine.conf entries are bogus */
/* size of the menu (MDI) buttons */
/* size of the menu (MDI) buttons */
lpnm
->
iMenuWidth
=
GetSystemMetrics
(
SM_CXMENUSIZE
)
;
lpnm
->
iMenuWidth
=
sysMetrics
[
SM_CXMENUSIZE
]
;
lpnm
->
iMenuHeight
=
GetSystemMetrics
(
SM_CYMENUSIZE
)
;
lpnm
->
iMenuHeight
=
sysMetrics
[
SM_CYMENUSIZE
]
;
/* menu font metrics */
/* menu font metrics */
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfMenuFont
),
0
);
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
(
LPVOID
)
&
(
lpnm
->
lfMenuFont
),
0
);
...
@@ -1512,12 +1637,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1512,12 +1637,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
if
(
SYSPARAMS_Load
(
SPI_SETSHOWSOUNDS_REGKEY
,
if
(
SYSPARAMS_Load
(
SPI_SETSHOWSOUNDS_REGKEY
,
SPI_SETSHOWSOUNDS_VALNAME
,
buf
,
sizeof
(
buf
)
))
SPI_SETSHOWSOUNDS_VALNAME
,
buf
,
sizeof
(
buf
)
))
{
{
SYSMETRICS_Set
(
SM_SHOWSOUNDS
,
atoiW
(
buf
)
);
sysMetrics
[
SM_SHOWSOUNDS
]
=
atoiW
(
buf
);
}
}
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
*
(
INT
*
)
pvParam
=
GetSystemMetrics
(
SM_SHOWSOUNDS
)
;
*
(
INT
*
)
pvParam
=
sysMetrics
[
SM_SHOWSOUNDS
]
;
break
;
break
;
case
SPI_SETSHOWSOUNDS
:
/* 57 */
case
SPI_SETSHOWSOUNDS
:
/* 57 */
...
@@ -1530,7 +1655,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
...
@@ -1530,7 +1655,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
SPI_SETSHOWSOUNDS_VALNAME
,
SPI_SETSHOWSOUNDS_VALNAME
,
buf
,
fWinIni
))
buf
,
fWinIni
))
{
{
SYSMETRICS_Set
(
SM_SHOWSOUNDS
,
uiParam
)
;
sysMetrics
[
SM_SHOWSOUNDS
]
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
}
else
else
...
@@ -2388,6 +2513,41 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
...
@@ -2388,6 +2513,41 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
}
}
/***********************************************************************
* GetSystemMetrics (USER32.@)
*/
INT
WINAPI
GetSystemMetrics
(
INT
index
)
{
/* some metrics are dynamic */
switch
(
index
)
{
case
SM_CXSCREEN
:
case
SM_CXFULLSCREEN
:
case
SM_CXVIRTUALSCREEN
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
);
case
SM_CYSCREEN
:
case
SM_CYVIRTUALSCREEN
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
);
case
SM_CYFULLSCREEN
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
-
sysMetrics
[
SM_CYCAPTION
];
/* FIXME: How do I calculate these? */
case
SM_CXMAXTRACK
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
)
+
4
+
2
*
sysMetrics
[
SM_CXFRAME
];
case
SM_CYMAXTRACK
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
+
4
+
2
*
sysMetrics
[
SM_CYFRAME
];
case
SM_CXMAXIMIZED
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
)
+
2
*
sysMetrics
[
SM_CXFRAME
];
case
SM_CYMAXIMIZED
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
+
2
*
sysMetrics
[
SM_CYFRAME
];
default:
if
((
index
<
0
)
||
(
index
>
SM_CMETRICS
))
return
0
;
return
sysMetrics
[
index
];
}
}
/**********************************************************************
/**********************************************************************
* SetDoubleClickTime (USER32.@)
* SetDoubleClickTime (USER32.@)
*/
*/
...
...
dlls/user/user_main.c
View file @
4a9b22b2
...
@@ -225,8 +225,7 @@ static BOOL process_attach(void)
...
@@ -225,8 +225,7 @@ static BOOL process_attach(void)
if
(
!
load_driver
())
return
FALSE
;
if
(
!
load_driver
())
return
FALSE
;
/* Initialize system colors and metrics */
/* Initialize system colors and metrics */
SYSMETRICS_Init
();
SYSPARAMS_Init
();
SYSCOLOR_Init
();
/* Setup palette function pointers */
/* Setup palette function pointers */
palette_init
();
palette_init
();
...
...
dlls/user/user_private.h
View file @
4a9b22b2
...
@@ -126,8 +126,7 @@ extern BOOL FOCUS_MouseActivate( HWND hwnd );
...
@@ -126,8 +126,7 @@ extern BOOL FOCUS_MouseActivate( HWND hwnd );
extern
BOOL
HOOK_IsHooked
(
INT
id
);
extern
BOOL
HOOK_IsHooked
(
INT
id
);
extern
void
SYSCOLOR_Init
(
void
);
extern
void
SYSCOLOR_Init
(
void
);
extern
HPEN
SYSCOLOR_GetPen
(
INT
index
);
extern
HPEN
SYSCOLOR_GetPen
(
INT
index
);
extern
void
SYSMETRICS_Init
(
void
);
extern
void
SYSPARAMS_Init
(
void
);
extern
INT
SYSMETRICS_Set
(
INT
index
,
INT
value
);
extern
void
USER_CheckNotLock
(
void
);
extern
void
USER_CheckNotLock
(
void
);
extern
BOOL
USER_IsExitingThread
(
DWORD
tid
);
extern
BOOL
USER_IsExitingThread
(
DWORD
tid
);
...
...
windows/sysmetrics.c
deleted
100644 → 0
View file @
f238cd88
/*
* System metrics functions
*
* Copyright 1994 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "user_private.h"
static
int
sysMetrics
[
SM_CMETRICS
+
1
];
static
HDC
display_dc
;
/***********************************************************************
* RegistryTwips2Pixels
*
* Convert a a dimension value that was obtained from the registry. These are
* quoted as being "twips" values if negative and pixels if positive.
* See for example
* MSDN Library - April 2001 -> Resource Kits ->
* Windows 2000 Resource Kit Reference ->
* Technical Reference to the Windows 2000 Registry ->
* HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics
*
* This is written as a function to prevent repeated evaluation of the
* argument.
*/
inline
static
int
RegistryTwips2Pixels
(
int
x
)
{
if
(
x
<
0
)
x
=
(
-
x
+
7
)
/
15
;
return
x
;
}
/***********************************************************************
* SYSMETRICS_GetRegistryMetric
*
* Get a registry entry from the already open key. This allows us to open the
* section once and read several values.
*
* Of course this function belongs somewhere more usable but here will do
* for now.
*/
static
int
SYSMETRICS_GetRegistryMetric
(
HKEY
hkey
,
/* handle to the registry section */
const
char
*
key
,
/* value name in the section */
int
default_value
)
/* default to return */
{
int
value
=
default_value
;
if
(
hkey
)
{
BYTE
buffer
[
128
];
DWORD
type
,
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
key
,
0
,
&
type
,
buffer
,
&
count
))
{
if
(
type
!=
REG_SZ
)
{
/* Are there any utilities for converting registry entries
* between formats?
*/
/* FIXME_(reg)("We need reg format converter\n"); */
}
else
value
=
atoi
(
buffer
);
}
}
return
RegistryTwips2Pixels
(
value
);
}
/***********************************************************************
* SYSMETRICS_Init
*
* Initialisation of the system metrics array.
*
* Differences in return values between 3.1 and 95 apps under Win95 (FIXME ?):
* SM_CXVSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CYHSCROLL x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CXDLGFRAME x-1 x Already fixed
* SM_CYDLGFRAME x-1 x Already fixed
* SM_CYCAPTION x+1 x Fixed May 24, 1999 - Ronald B. Cemer
* SM_CYMENU x-1 x Already fixed
* SM_CYFULLSCREEN x-1 x
* SM_CXFRAME Fixed July 6, 2001 - Bill Medland
*
* Starting at Win95 there are now a large number or Registry entries in the
* [WindowMetrics] section that are probably relevant here.
*/
void
SYSMETRICS_Init
(
void
)
{
HKEY
hkey
;
/* key to the window metrics area of the registry */
INT
dummy
;
display_dc
=
CreateICA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
assert
(
display_dc
);
if
(
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
"Control Panel
\\
desktop
\\
WindowMetrics"
,
0
,
KEY_QUERY_VALUE
,
&
hkey
)
!=
ERROR_SUCCESS
)
hkey
=
0
;
sysMetrics
[
SM_CXVSCROLL
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"ScrollWidth"
,
16
);
sysMetrics
[
SM_CYHSCROLL
]
=
sysMetrics
[
SM_CXVSCROLL
];
/* The Win 2000 resource kit SAYS that this is governed by the ScrollHeight
* but on my computer that controls the CYV/CXH values. */
sysMetrics
[
SM_CYCAPTION
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"CaptionHeight"
,
18
)
+
1
;
/* for the separator? */
sysMetrics
[
SM_CYMENU
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"MenuHeight"
,
18
)
+
1
;
sysMetrics
[
SM_CXDLGFRAME
]
=
3
;
sysMetrics
[
SM_CYDLGFRAME
]
=
sysMetrics
[
SM_CXDLGFRAME
];
/* force setting of SM_CXFRAME/SM_CYFRAME */
SystemParametersInfoA
(
SPI_GETBORDER
,
0
,
&
dummy
,
0
);
sysMetrics
[
SM_CXCURSOR
]
=
32
;
sysMetrics
[
SM_CYCURSOR
]
=
32
;
sysMetrics
[
SM_CXBORDER
]
=
1
;
sysMetrics
[
SM_CYBORDER
]
=
sysMetrics
[
SM_CXBORDER
];
sysMetrics
[
SM_CYVTHUMB
]
=
sysMetrics
[
SM_CXVSCROLL
];
sysMetrics
[
SM_CXHTHUMB
]
=
sysMetrics
[
SM_CYVTHUMB
];
sysMetrics
[
SM_CXICON
]
=
32
;
sysMetrics
[
SM_CYICON
]
=
32
;
sysMetrics
[
SM_CYKANJIWINDOW
]
=
0
;
sysMetrics
[
SM_MOUSEPRESENT
]
=
1
;
sysMetrics
[
SM_CYVSCROLL
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"ScrollHeight"
,
sysMetrics
[
SM_CXVSCROLL
]);
sysMetrics
[
SM_CXHSCROLL
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"ScrollHeight"
,
sysMetrics
[
SM_CYHSCROLL
]);
sysMetrics
[
SM_DEBUG
]
=
0
;
sysMetrics
[
SM_SWAPBUTTON
]
=
0
;
sysMetrics
[
SM_SWAPBUTTON
]
=
SYSPARAMS_GetMouseButtonSwap
();
sysMetrics
[
SM_RESERVED1
]
=
0
;
sysMetrics
[
SM_RESERVED2
]
=
0
;
sysMetrics
[
SM_RESERVED3
]
=
0
;
sysMetrics
[
SM_RESERVED4
]
=
0
;
/* FIXME: The following two are calculated, but how? */
sysMetrics
[
SM_CXMIN
]
=
112
;
sysMetrics
[
SM_CYMIN
]
=
27
;
sysMetrics
[
SM_CXSIZE
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"CaptionWidth"
,
sysMetrics
[
SM_CYCAPTION
]
-
1
);
sysMetrics
[
SM_CYSIZE
]
=
sysMetrics
[
SM_CYCAPTION
]
-
1
;
sysMetrics
[
SM_CXMINTRACK
]
=
sysMetrics
[
SM_CXMIN
];
sysMetrics
[
SM_CYMINTRACK
]
=
sysMetrics
[
SM_CYMIN
];
sysMetrics
[
SM_CXDOUBLECLK
]
=
4
;
sysMetrics
[
SM_CYDOUBLECLK
]
=
4
;
SYSPARAMS_GetDoubleClickSize
(
&
sysMetrics
[
SM_CXDOUBLECLK
],
&
sysMetrics
[
SM_CYDOUBLECLK
]
);
sysMetrics
[
SM_CXICONSPACING
]
=
75
;
SystemParametersInfoA
(
SPI_ICONHORIZONTALSPACING
,
0
,
&
sysMetrics
[
SM_CXICONSPACING
],
0
);
sysMetrics
[
SM_CYICONSPACING
]
=
75
;
SystemParametersInfoA
(
SPI_ICONVERTICALSPACING
,
0
,
&
sysMetrics
[
SM_CYICONSPACING
],
0
);
SystemParametersInfoA
(
SPI_GETMENUDROPALIGNMENT
,
0
,
&
sysMetrics
[
SM_MENUDROPALIGNMENT
],
0
);
sysMetrics
[
SM_PENWINDOWS
]
=
0
;
sysMetrics
[
SM_DBCSENABLED
]
=
0
;
/* FIXME: Need to query X for the following */
sysMetrics
[
SM_CMOUSEBUTTONS
]
=
3
;
sysMetrics
[
SM_SECURE
]
=
0
;
sysMetrics
[
SM_CXEDGE
]
=
sysMetrics
[
SM_CXBORDER
]
+
1
;
sysMetrics
[
SM_CYEDGE
]
=
sysMetrics
[
SM_CXEDGE
];
sysMetrics
[
SM_CXMINSPACING
]
=
160
;
sysMetrics
[
SM_CYMINSPACING
]
=
24
;
sysMetrics
[
SM_CXSMICON
]
=
16
;
sysMetrics
[
SM_CYSMICON
]
=
16
;
sysMetrics
[
SM_CYSMCAPTION
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"SmCaptionHeight"
,
15
)
+
1
;
sysMetrics
[
SM_CXSMSIZE
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"SmCaptionWidth"
,
13
);
sysMetrics
[
SM_CYSMSIZE
]
=
sysMetrics
[
SM_CYSMCAPTION
]
-
1
;
sysMetrics
[
SM_CXMENUSIZE
]
=
SYSMETRICS_GetRegistryMetric
(
hkey
,
"MenuWidth"
,
sysMetrics
[
SM_CYMENU
]
-
1
);
sysMetrics
[
SM_CYMENUSIZE
]
=
sysMetrics
[
SM_CYMENU
]
-
1
;
/* FIXME: What do these mean? */
sysMetrics
[
SM_ARRANGE
]
=
ARW_HIDE
;
sysMetrics
[
SM_CXMINIMIZED
]
=
160
;
sysMetrics
[
SM_CYMINIMIZED
]
=
24
;
/* FIXME: How do I calculate these? */
sysMetrics
[
SM_NETWORK
]
=
3
;
/* For the following: 0 = ok, 1 = failsafe, 2 = failsafe + network */
sysMetrics
[
SM_CLEANBOOT
]
=
0
;
sysMetrics
[
SM_CXDRAG
]
=
4
;
sysMetrics
[
SM_CYDRAG
]
=
4
;
sysMetrics
[
SM_CXMENUCHECK
]
=
13
;
sysMetrics
[
SM_CYMENUCHECK
]
=
13
;
/* FIXME: Should check the type of processor for the following */
sysMetrics
[
SM_SLOWMACHINE
]
=
0
;
/* FIXME: Should perform a check */
sysMetrics
[
SM_MIDEASTENABLED
]
=
0
;
sysMetrics
[
SM_MOUSEWHEELPRESENT
]
=
1
;
sysMetrics
[
SM_XVIRTUALSCREEN
]
=
0
;
sysMetrics
[
SM_YVIRTUALSCREEN
]
=
0
;
sysMetrics
[
SM_CMONITORS
]
=
1
;
sysMetrics
[
SM_SAMEDISPLAYFORMAT
]
=
1
;
sysMetrics
[
SM_CMETRICS
]
=
SM_CMETRICS
;
SystemParametersInfoA
(
SPI_GETSHOWSOUNDS
,
0
,
&
sysMetrics
[
SM_SHOWSOUNDS
],
0
);
if
(
hkey
)
RegCloseKey
(
hkey
);
}
/***********************************************************************
* SYSMETRICS_Set
*
* Sets system metrics.
*/
INT
SYSMETRICS_Set
(
INT
index
,
INT
value
)
{
if
((
index
<
0
)
||
(
index
>
SM_CMETRICS
))
return
0
;
else
{
INT
prev
=
sysMetrics
[
index
];
sysMetrics
[
index
]
=
value
;
return
prev
;
}
}
/***********************************************************************
* GetSystemMetrics (USER32.@)
*/
INT
WINAPI
GetSystemMetrics
(
INT
index
)
{
/* some metrics are dynamic */
switch
(
index
)
{
case
SM_CXSCREEN
:
case
SM_CXFULLSCREEN
:
case
SM_CXVIRTUALSCREEN
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
);
case
SM_CYSCREEN
:
case
SM_CYVIRTUALSCREEN
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
);
case
SM_CYFULLSCREEN
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
-
sysMetrics
[
SM_CYCAPTION
];
/* FIXME: How do I calculate these? */
case
SM_CXMAXTRACK
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
)
+
4
+
2
*
sysMetrics
[
SM_CXFRAME
];
case
SM_CYMAXTRACK
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
+
4
+
2
*
sysMetrics
[
SM_CYFRAME
];
case
SM_CXMAXIMIZED
:
return
GetDeviceCaps
(
display_dc
,
HORZRES
)
+
2
*
sysMetrics
[
SM_CXFRAME
];
case
SM_CYMAXIMIZED
:
return
GetDeviceCaps
(
display_dc
,
VERTRES
)
+
2
*
sysMetrics
[
SM_CYFRAME
];
default:
if
((
index
<
0
)
||
(
index
>
SM_CMETRICS
))
return
0
;
return
sysMetrics
[
index
];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment