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
2a56d159
Commit
2a56d159
authored
Feb 07, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Feb 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Move the getting of the DC outside of ANIMATE_DrawFrame.
This allows the handle to the DC to be passed in the WM_CTLCOLORSTATIC message sent to the parent.
parent
62a92d16
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
animate.c
dlls/comctl32/animate.c
+25
-13
No files found.
dlls/comctl32/animate.c
View file @
2a56d159
...
...
@@ -345,10 +345,8 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
return
TRUE
;
}
static
BOOL
ANIMATE_DrawFrame
(
ANIMATE_INFO
*
infoPtr
)
static
BOOL
ANIMATE_DrawFrame
(
ANIMATE_INFO
*
infoPtr
,
HDC
hDC
)
{
HDC
hDC
;
TRACE
(
"Drawing frame %d (loop %d)
\n
"
,
infoPtr
->
currFrame
,
infoPtr
->
nLoop
);
mmioSeek
(
infoPtr
->
hMMio
,
infoPtr
->
lpIndex
[
infoPtr
->
currFrame
],
SEEK_SET
);
...
...
@@ -361,10 +359,7 @@ static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr)
return
FALSE
;
}
if
((
hDC
=
GetDC
(
infoPtr
->
hwndSelf
))
!=
0
)
{
ANIMATE_PaintFrame
(
infoPtr
,
hDC
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hDC
);
}
if
(
infoPtr
->
currFrame
++
>=
infoPtr
->
nToFrame
)
{
infoPtr
->
currFrame
=
infoPtr
->
nFromFrame
;
...
...
@@ -380,15 +375,21 @@ static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr)
static
LRESULT
ANIMATE_Timer
(
ANIMATE_INFO
*
infoPtr
)
{
/* FIXME: we should pass the hDC instead of 0 to WM_CTLCOLORSTATIC */
HDC
hDC
;
if
((
hDC
=
GetDC
(
infoPtr
->
hwndSelf
))
!=
0
)
{
if
(
infoPtr
->
dwStyle
&
ACS_TRANSPARENT
)
infoPtr
->
hbrushBG
=
(
HBRUSH
)
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_CTLCOLORSTATIC
,
0
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
(
WPARAM
)
hDC
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
EnterCriticalSection
(
&
infoPtr
->
cs
);
ANIMATE_DrawFrame
(
infoPtr
);
ANIMATE_DrawFrame
(
infoPtr
,
hDC
);
LeaveCriticalSection
(
&
infoPtr
->
cs
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hDC
);
}
return
0
;
}
...
...
@@ -400,16 +401,20 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
while
(
1
)
{
HDC
hDC
=
GetDC
(
infoPtr
->
hwndSelf
);
if
(
infoPtr
->
dwStyle
&
ACS_TRANSPARENT
)
infoPtr
->
hbrushBG
=
(
HBRUSH
)
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_CTLCOLORSTATIC
,
0
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
(
WPARAM
)
hDC
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
EnterCriticalSection
(
&
infoPtr
->
cs
);
ANIMATE_DrawFrame
(
infoPtr
);
ANIMATE_DrawFrame
(
infoPtr
,
hDC
);
timeout
=
infoPtr
->
mah
.
dwMicroSecPerFrame
;
event
=
infoPtr
->
hStopEvent
;
LeaveCriticalSection
(
&
infoPtr
->
cs
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hDC
);
/* time is in microseconds, we should convert it to milliseconds */
if
((
event
==
0
)
||
WaitForSingleObject
(
event
,
(
timeout
+
500
)
/
1000
)
==
WAIT_OBJECT_0
)
break
;
...
...
@@ -452,11 +457,18 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
* does it send a notification */
if
(
infoPtr
->
nFromFrame
==
infoPtr
->
nToFrame
)
{
HDC
hDC
;
if
((
hDC
=
GetDC
(
infoPtr
->
hwndSelf
))
!=
0
)
{
if
(
infoPtr
->
dwStyle
&
ACS_TRANSPARENT
)
infoPtr
->
hbrushBG
=
(
HBRUSH
)
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_CTLCOLORSTATIC
,
0
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
ANIMATE_DrawFrame
(
infoPtr
);
(
WPARAM
)
hDC
,
(
LPARAM
)
infoPtr
->
hwndSelf
);
ANIMATE_DrawFrame
(
infoPtr
,
hDC
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hDC
);
}
return
TRUE
;
}
...
...
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