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
2fa7cadf
Commit
2fa7cadf
authored
Dec 01, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Use the default icon title font when writing the caption text out in…
ole32: Use the default icon title font when writing the caption text out in OleMetafilePictFromIconAndLabel.
parent
f0e2ea54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
ole32_main.c
dlls/ole32/ole32_main.c
+18
-0
No files found.
dlls/ole32/ole32_main.c
View file @
2fa7cadf
...
...
@@ -49,15 +49,29 @@ HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLabel,
INT
icon_height
;
INT
label_offset
;
HDC
hdcScreen
;
LOGFONTW
lf
;
HFONT
font
;
TRACE
(
"%p %p %s %d
\n
"
,
hIcon
,
lpszLabel
,
debugstr_w
(
lpszSourceFile
),
iIconIndex
);
if
(
!
hIcon
)
return
NULL
;
if
(
!
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
sizeof
(
lf
),
&
lf
,
0
))
return
NULL
;
font
=
CreateFontIndirectW
(
&
lf
);
if
(
!
font
)
return
NULL
;
hdc
=
CreateMetaFileW
(
NULL
);
if
(
!
hdc
)
{
DeleteObject
(
font
);
return
NULL
;
}
SelectObject
(
hdc
,
font
);
ExtEscape
(
hdc
,
MFCOMMENT
,
sizeof
(
szIconOnly
),
szIconOnly
,
0
,
NULL
);
...
...
@@ -67,10 +81,13 @@ HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLabel,
label_offset
=
icon_height
;
if
(
lpszLabel
)
{
HFONT
screen_old_font
;
/* metafile DCs don't support GetTextExtentPoint32, so size the font
* using the desktop window DC */
hdcScreen
=
GetDC
(
NULL
);
screen_old_font
=
SelectObject
(
hdcScreen
,
font
);
GetTextExtentPoint32W
(
hdcScreen
,
lpszLabel
,
lstrlenW
(
lpszLabel
),
&
text_size
);
SelectObject
(
hdcScreen
,
screen_old_font
);
ReleaseDC
(
NULL
,
hdcScreen
);
}
width
=
max
(
text_size
.
cx
,
icon_width
);
...
...
@@ -105,6 +122,7 @@ HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLabel,
mfp
.
mm
=
MM_ANISOTROPIC
;
mfp
.
xExt
=
mfp
.
yExt
=
0
;
/* FIXME ? */
mfp
.
hMF
=
CloseMetaFile
(
hdc
);
DeleteObject
(
font
);
if
(
!
mfp
.
hMF
)
return
NULL
;
...
...
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