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
5ca79e66
Commit
5ca79e66
authored
Mar 04, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Mar 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/hotkey: Implement themed frame painting.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52992a99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
hotkey.c
dlls/comctl32/hotkey.c
+48
-0
No files found.
dlls/comctl32/hotkey.c
View file @
5ca79e66
...
...
@@ -37,6 +37,7 @@
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "uxtheme.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -424,6 +425,50 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
}
static
LRESULT
HOTKEY_NCPaint
(
HWND
hwnd
,
HRGN
region
)
{
INT
cxEdge
,
cyEdge
;
HRGN
clipRgn
;
HTHEME
theme
;
LONG
exStyle
;
RECT
r
;
HDC
dc
;
theme
=
OpenThemeData
(
NULL
,
WC_EDITW
);
if
(
!
theme
)
return
DefWindowProcW
(
hwnd
,
WM_NCPAINT
,
(
WPARAM
)
region
,
0
);
exStyle
=
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
);
if
(
!
(
exStyle
&
WS_EX_CLIENTEDGE
))
{
CloseThemeData
(
theme
);
return
DefWindowProcW
(
hwnd
,
WM_NCPAINT
,
(
WPARAM
)
region
,
0
);
}
cxEdge
=
GetSystemMetrics
(
SM_CXEDGE
);
cyEdge
=
GetSystemMetrics
(
SM_CYEDGE
);
GetWindowRect
(
hwnd
,
&
r
);
/* New clipping region passed to default proc to exclude border */
clipRgn
=
CreateRectRgn
(
r
.
left
+
cxEdge
,
r
.
top
+
cyEdge
,
r
.
right
-
cxEdge
,
r
.
bottom
-
cyEdge
);
if
(
region
!=
(
HRGN
)
1
)
CombineRgn
(
clipRgn
,
clipRgn
,
region
,
RGN_AND
);
OffsetRect
(
&
r
,
-
r
.
left
,
-
r
.
top
);
dc
=
GetDCEx
(
hwnd
,
region
,
DCX_WINDOW
|
DCX_INTERSECTRGN
);
if
(
IsThemeBackgroundPartiallyTransparent
(
theme
,
0
,
0
))
DrawThemeParentBackground
(
hwnd
,
dc
,
&
r
);
DrawThemeBackground
(
theme
,
dc
,
0
,
0
,
&
r
,
0
);
ReleaseDC
(
hwnd
,
dc
);
CloseThemeData
(
theme
);
/* Call default proc to get the scrollbars etc. also painted */
DefWindowProcW
(
hwnd
,
WM_NCPAINT
,
(
WPARAM
)
clipRgn
,
0
);
DeleteObject
(
clipRgn
);
return
0
;
}
static
LRESULT
HOTKEY_SetFocus
(
HOTKEY_INFO
*
infoPtr
)
{
infoPtr
->
bFocus
=
TRUE
;
...
...
@@ -516,6 +561,9 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_NCCREATE
:
return
HOTKEY_NCCreate
(
hwnd
,
(
LPCREATESTRUCTW
)
lParam
);
case
WM_NCPAINT
:
return
HOTKEY_NCPaint
(
hwnd
,
(
HRGN
)
wParam
);
case
WM_PRINTCLIENT
:
case
WM_PAINT
:
HOTKEY_Paint
(
infoPtr
,
(
HDC
)
wParam
);
...
...
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