Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
74a9c919
Commit
74a9c919
authored
Apr 12, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Get the system DPI from the registry instead of from GDI.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
edb7f512
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
sysparams.c
dlls/user32/sysparams.c
+26
-6
No files found.
dlls/user32/sysparams.c
View file @
74a9c919
...
...
@@ -612,6 +612,31 @@ static BOOL init_entry_string( struct sysparam_entry *entry, const WCHAR *str )
return
init_entry
(
entry
,
str
,
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
),
REG_SZ
);
}
static
DWORD
get_reg_dword
(
HKEY
base
,
const
WCHAR
*
key_name
,
const
WCHAR
*
value_name
)
{
HKEY
key
;
DWORD
type
,
ret
=
0
,
size
=
sizeof
(
ret
);
if
(
RegOpenKeyW
(
base
,
key_name
,
&
key
))
return
0
;
if
(
RegQueryValueExW
(
key
,
value_name
,
NULL
,
&
type
,
(
void
*
)
&
ret
,
&
size
)
||
type
!=
REG_DWORD
)
ret
=
0
;
RegCloseKey
(
key
);
return
ret
;
}
/* get the system dpi from the registry */
static
UINT
get_system_dpi
(
void
)
{
static
const
WCHAR
dpi_key_name
[]
=
{
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
' '
,
'P'
,
'a'
,
'n'
,
'e'
,
'l'
,
'\\'
,
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'\0'
};
static
const
WCHAR
def_dpi_key_name
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
dpi_value_name
[]
=
{
'L'
,
'o'
,
'g'
,
'P'
,
'i'
,
'x'
,
'e'
,
'l'
,
's'
,
'\0'
};
DWORD
dpi
;
if
((
dpi
=
get_reg_dword
(
HKEY_CURRENT_USER
,
dpi_key_name
,
dpi_value_name
)))
return
dpi
;
if
((
dpi
=
get_reg_dword
(
HKEY_CURRENT_CONFIG
,
def_dpi_key_name
,
dpi_value_name
)))
return
dpi
;
return
USER_DEFAULT_SCREEN_DPI
;
}
HDC
get_display_dc
(
void
)
{
static
const
WCHAR
DISPLAY
[]
=
{
'D'
,
'I'
,
'S'
,
'P'
,
'L'
,
'A'
,
'Y'
,
0
};
...
...
@@ -3065,12 +3090,7 @@ UINT WINAPI GetDpiForSystem(void)
if
(
!
IsProcessDPIAware
())
return
USER_DEFAULT_SCREEN_DPI
;
if
(
!
display_dpi
)
{
HDC
hdc
=
get_display_dc
();
display_dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
release_display_dc
(
hdc
);
}
if
(
!
display_dpi
)
display_dpi
=
get_system_dpi
();
return
display_dpi
;
}
...
...
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