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
3f9aec17
Commit
3f9aec17
authored
Aug 26, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Aug 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add test demonstrating the WM_PAINT loop.
parent
bcc1bb2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
msg.c
dlls/user32/tests/msg.c
+56
-0
No files found.
dlls/user32/tests/msg.c
View file @
3f9aec17
...
...
@@ -1584,6 +1584,7 @@ static int after_end_dialog, test_def_id;
static
int
sequence_cnt
,
sequence_size
;
static
struct
message
*
sequence
;
static
int
log_all_parent_messages
;
static
int
paint_loop_done
;
/* user32 functions */
static
HWND
(
WINAPI
*
pGetAncestor
)(
HWND
,
UINT
);
...
...
@@ -7039,6 +7040,31 @@ static LRESULT WINAPI ShowWindowProcA(HWND hwnd, UINT message, WPARAM wParam, LP
return
ret
;
}
LRESULT
WINAPI
PaintLoopProcA
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_CREATE
:
return
0
;
case
WM_PAINT
:
{
MSG
msg2
;
static
int
i
=
0
;
i
++
;
if
(
PeekMessageA
(
&
msg2
,
0
,
0
,
0
,
1
))
{
TranslateMessage
(
&
msg2
);
DispatchMessage
(
&
msg2
);
}
i
--
;
if
(
i
==
0
)
paint_loop_done
=
1
;
return
DefWindowProcA
(
hWnd
,
msg
,
wParam
,
lParam
);
}
}
return
DefWindowProcA
(
hWnd
,
msg
,
wParam
,
lParam
);
}
static
BOOL
RegisterWindowClasses
(
void
)
{
WNDCLASSA
cls
;
...
...
@@ -7072,6 +7098,10 @@ static BOOL RegisterWindowClasses(void)
cls
.
lpszClassName
=
"SimpleWindowClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
cls
.
lpfnWndProc
=
PaintLoopProcA
;
cls
.
lpszClassName
=
"PaintLoopWindowClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
cls
.
style
=
CS_NOCLOSE
;
cls
.
lpszClassName
=
"NoCloseWindowClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
...
...
@@ -11033,6 +11063,31 @@ static void test_menu_messages(void)
DestroyMenu
(
hmenu
);
}
static
void
test_paintingloop
(
void
)
{
HWND
hwnd
;
paint_loop_done
=
0
;
hwnd
=
CreateWindowExA
(
0x0
,
"PaintLoopWindowClass"
,
"PaintLoopWindowClass"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"PaintLoop window error %u
\n
"
,
GetLastError
());
ShowWindow
(
hwnd
,
SW_NORMAL
);
SetFocus
(
hwnd
);
while
(
!
paint_loop_done
)
{
MSG
msg
;
if
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
1
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
}
}
DestroyWindow
(
hwnd
);
}
START_TEST
(
msg
)
{
BOOL
ret
;
...
...
@@ -11116,6 +11171,7 @@ START_TEST(msg)
test_nullCallback
();
test_dbcs_wm_char
();
test_menu_messages
();
test_paintingloop
();
/* keep it the last test, under Windows it tends to break the tests
* which rely on active/foreground windows being correct.
*/
...
...
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