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
fa5c9826
Commit
fa5c9826
authored
Feb 22, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DispatchMessage needs to repaint the non-client area if the WM_PAINT
handler didn't do it.
parent
e4c2d6ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
msg.c
dlls/user/tests/msg.c
+75
-0
message.c
windows/message.c
+14
-0
No files found.
dlls/user/tests/msg.c
View file @
fa5c9826
...
@@ -5495,6 +5495,80 @@ static void test_DestroyWindow(void)
...
@@ -5495,6 +5495,80 @@ static void test_DestroyWindow(void)
ok
(
!
IsWindow
(
child4
),
"child4 still exists"
);
ok
(
!
IsWindow
(
child4
),
"child4 still exists"
);
}
}
static
const
struct
message
WmDispatchPaint
[]
=
{
{
WM_NCPAINT
,
sent
},
{
WM_GETTEXT
,
sent
|
defwinproc
|
optional
},
{
WM_GETTEXT
,
sent
|
defwinproc
|
optional
},
{
WM_ERASEBKGND
,
sent
},
{
0
}
};
static
LRESULT
WINAPI
DispatchMessageCheckProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
message
==
WM_PAINT
)
{
trace
(
"Got WM_PAINT, ignoring
\n
"
);
return
0
;
}
return
MsgCheckProcA
(
hwnd
,
message
,
wParam
,
lParam
);
}
static
void
test_DispatchMessage
(
void
)
{
RECT
rect
;
MSG
msg
;
int
count
;
HWND
hwnd
=
CreateWindowA
(
"TestWindowClass"
,
NULL
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
flush_sequence
();
SetWindowLongPtrA
(
hwnd
,
GWL_WNDPROC
,
(
LONG_PTR
)
DispatchMessageCheckProc
);
SetRect
(
&
rect
,
-
5
,
-
5
,
5
,
5
);
RedrawWindow
(
hwnd
,
&
rect
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_FRAME
);
count
=
0
;
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
!=
WM_PAINT
)
DispatchMessage
(
&
msg
);
else
{
flush_sequence
();
DispatchMessage
(
&
msg
);
/* DispatchMessage will send WM_NCPAINT if non client area is still invalid after WM_PAINT */
if
(
!
count
)
ok_sequence
(
WmDispatchPaint
,
"WmDispatchPaint"
,
FALSE
);
else
ok_sequence
(
WmEmptySeq
,
"WmEmpty"
,
FALSE
);
if
(
++
count
>
10
)
break
;
}
}
ok
(
msg
.
message
==
WM_PAINT
&&
count
>
10
,
"WM_PAINT messages stopped
\n
"
);
trace
(
"now without DispatchMessage
\n
"
);
flush_sequence
();
RedrawWindow
(
hwnd
,
&
rect
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_FRAME
);
count
=
0
;
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
!=
WM_PAINT
)
DispatchMessage
(
&
msg
);
else
{
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
flush_sequence
();
/* this will send WM_NCCPAINT just like DispatchMessage does */
GetUpdateRgn
(
hwnd
,
hrgn
,
TRUE
);
ok_sequence
(
WmDispatchPaint
,
"WmDispatchPaint"
,
FALSE
);
DeleteObject
(
hrgn
);
GetClientRect
(
hwnd
,
&
rect
);
ValidateRect
(
hwnd
,
&
rect
);
/* this will stop WM_PAINTs */
ok
(
!
count
,
"Got multiple WM_PAINTs
\n
"
);
if
(
++
count
>
10
)
break
;
}
}
}
START_TEST
(
msg
)
START_TEST
(
msg
)
{
{
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
...
@@ -5544,6 +5618,7 @@ START_TEST(msg)
...
@@ -5544,6 +5618,7 @@ START_TEST(msg)
test_timers
();
test_timers
();
test_set_hook
();
test_set_hook
();
test_DestroyWindow
();
test_DestroyWindow
();
test_DispatchMessage
();
UnhookWindowsHookEx
(
hCBT_hook
);
UnhookWindowsHookEx
(
hCBT_hook
);
if
(
pUnhookWinEvent
)
if
(
pUnhookWinEvent
)
...
...
windows/message.c
View file @
fa5c9826
...
@@ -795,6 +795,13 @@ LONG WINAPI DispatchMessageA( const MSG* msg )
...
@@ -795,6 +795,13 @@ LONG WINAPI DispatchMessageA( const MSG* msg )
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
msg
->
wParam
,
msg
->
lParam
);
msg
->
wParam
,
msg
->
lParam
);
if
(
msg
->
message
==
WM_PAINT
)
{
/* send a WM_NCPAINT and WM_ERASEBKGND if the non-client area is still invalid */
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
GetUpdateRgn
(
msg
->
hwnd
,
hrgn
,
TRUE
);
DeleteObject
(
hrgn
);
}
return
retval
;
return
retval
;
}
}
...
@@ -866,6 +873,13 @@ LONG WINAPI DispatchMessageW( const MSG* msg )
...
@@ -866,6 +873,13 @@ LONG WINAPI DispatchMessageW( const MSG* msg )
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
msg
->
wParam
,
msg
->
lParam
);
msg
->
wParam
,
msg
->
lParam
);
if
(
msg
->
message
==
WM_PAINT
)
{
/* send a WM_NCPAINT and WM_ERASEBKGND if the non-client area is still invalid */
HRGN
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
GetUpdateRgn
(
msg
->
hwnd
,
hrgn
,
TRUE
);
DeleteObject
(
hrgn
);
}
return
retval
;
return
retval
;
}
}
...
...
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