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
07cfce6e
Commit
07cfce6e
authored
Feb 09, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add message tests for SetParent().
parent
de2aeebe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
0 deletions
+121
-0
msg.c
dlls/user32/tests/msg.c
+121
-0
No files found.
dlls/user32/tests/msg.c
View file @
07cfce6e
...
...
@@ -12664,6 +12664,126 @@ static void test_WaitForInputIdle( char *argv0 )
CloseHandle
(
thread
);
}
static
const
struct
message
WmSetParentSeq_1
[]
=
{
{
WM_SHOWWINDOW
,
sent
|
wparam
,
0
},
{
EVENT_OBJECT_PARENTCHANGE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_WINDOWPOSCHANGING
,
sent
|
wparam
,
SWP_NOSIZE
},
{
WM_CHILDACTIVATE
,
sent
},
{
WM_WINDOWPOSCHANGED
,
sent
|
wparam
,
SWP_NOSIZE
|
SWP_NOREDRAW
|
SWP_NOCLIENTSIZE
},
{
WM_MOVE
,
sent
|
defwinproc
|
wparam
,
0
},
{
EVENT_OBJECT_LOCATIONCHANGE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_SHOWWINDOW
,
sent
|
wparam
,
1
},
{
0
}
};
static
const
struct
message
WmSetParentSeq_2
[]
=
{
{
WM_SHOWWINDOW
,
sent
|
wparam
,
0
},
{
WM_WINDOWPOSCHANGING
,
sent
|
wparam
,
SWP_HIDEWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
},
{
EVENT_OBJECT_HIDE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_WINDOWPOSCHANGED
,
sent
|
wparam
,
SWP_HIDEWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
},
{
WM_NCACTIVATE
,
sent
|
wparam
,
0
},
{
WM_ACTIVATE
,
sent
|
wparam
,
0
},
{
WM_ACTIVATEAPP
,
sent
|
wparam
,
0
},
{
WM_KILLFOCUS
,
sent
|
wparam
,
0
},
{
EVENT_OBJECT_PARENTCHANGE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_WINDOWPOSCHANGING
,
sent
|
wparam
,
SWP_NOSIZE
},
{
HCBT_ACTIVATE
,
hook
},
{
EVENT_SYSTEM_FOREGROUND
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_WINDOWPOSCHANGING
,
sent
|
wparam
,
SWP_NOSIZE
|
SWP_NOMOVE
},
{
WM_NCACTIVATE
,
sent
|
wparam
,
1
},
{
WM_ACTIVATE
,
sent
|
wparam
,
1
},
{
HCBT_SETFOCUS
,
hook
},
{
EVENT_OBJECT_FOCUS
,
winevent_hook
|
wparam
|
lparam
,
OBJID_CLIENT
,
0
},
{
WM_SETFOCUS
,
sent
|
defwinproc
},
{
WM_WINDOWPOSCHANGED
,
sent
|
wparam
,
SWP_NOREDRAW
|
SWP_NOSIZE
|
SWP_NOCLIENTSIZE
},
{
WM_MOVE
,
sent
|
defwinproc
|
wparam
,
0
},
{
EVENT_OBJECT_LOCATIONCHANGE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_SHOWWINDOW
,
sent
|
wparam
,
1
},
{
WM_WINDOWPOSCHANGING
,
sent
|
wparam
,
SWP_SHOWWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
},
{
EVENT_OBJECT_SHOW
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
WM_WINDOWPOSCHANGED
,
sent
|
wparam
,
SWP_SHOWWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
},
{
0
}
};
static
void
test_SetParent
(
void
)
{
HWND
parent1
,
parent2
,
child
,
popup
;
RECT
rc
,
rc_old
;
parent1
=
CreateWindowEx
(
0
,
"TestParentClass"
,
NULL
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
parent1
!=
0
,
"Failed to create parent1 window
\n
"
);
parent2
=
CreateWindowEx
(
0
,
"TestParentClass"
,
NULL
,
WS_OVERLAPPEDWINDOW
,
400
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
parent2
!=
0
,
"Failed to create parent2 window
\n
"
);
/* WS_CHILD window */
child
=
CreateWindowEx
(
0
,
"TestWindowClass"
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
10
,
10
,
150
,
150
,
parent1
,
0
,
0
,
NULL
);
ok
(
child
!=
0
,
"Failed to create child window
\n
"
);
GetWindowRect
(
parent1
,
&
rc
);
trace
(
"parent1 (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
GetWindowRect
(
child
,
&
rc_old
);
MapWindowPoints
(
0
,
parent1
,
(
POINT
*
)
&
rc_old
,
2
);
trace
(
"child (%d,%d)-(%d,%d)
\n
"
,
rc_old
.
left
,
rc_old
.
top
,
rc_old
.
right
,
rc_old
.
bottom
);
flush_sequence
();
SetParent
(
child
,
parent2
);
flush_events
();
ok_sequence
(
WmSetParentSeq_1
,
"SetParent() visible WS_CHILD"
,
TRUE
);
ok
(
GetWindowLongA
(
child
,
GWL_STYLE
)
&
WS_VISIBLE
,
"WS_VISIBLE should be set
\n
"
);
ok
(
!
IsWindowVisible
(
child
),
"IsWindowVisible() should return FALSE
\n
"
);
GetWindowRect
(
parent2
,
&
rc
);
trace
(
"parent2 (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
GetWindowRect
(
child
,
&
rc
);
MapWindowPoints
(
0
,
parent2
,
(
POINT
*
)
&
rc
,
2
);
trace
(
"child (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
ok
(
EqualRect
(
&
rc_old
,
&
rc
),
"rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)
\n
"
,
rc_old
.
left
,
rc_old
.
top
,
rc_old
.
right
,
rc_old
.
bottom
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
/* WS_POPUP window */
popup
=
CreateWindowEx
(
0
,
"TestWindowClass"
,
NULL
,
WS_POPUP
|
WS_VISIBLE
,
20
,
20
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
popup
!=
0
,
"Failed to create popup window
\n
"
);
GetWindowRect
(
popup
,
&
rc_old
);
trace
(
"popup (%d,%d)-(%d,%d)
\n
"
,
rc_old
.
left
,
rc_old
.
top
,
rc_old
.
right
,
rc_old
.
bottom
);
flush_sequence
();
SetParent
(
popup
,
child
);
flush_events
();
ok_sequence
(
WmSetParentSeq_2
,
"SetParent() visible WS_POPUP"
,
TRUE
);
ok
(
GetWindowLongA
(
popup
,
GWL_STYLE
)
&
WS_VISIBLE
,
"WS_VISIBLE should be set
\n
"
);
ok
(
!
IsWindowVisible
(
popup
),
"IsWindowVisible() should return FALSE
\n
"
);
GetWindowRect
(
child
,
&
rc
);
trace
(
"parent2 (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
GetWindowRect
(
popup
,
&
rc
);
MapWindowPoints
(
0
,
child
,
(
POINT
*
)
&
rc
,
2
);
trace
(
"popup (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
ok
(
EqualRect
(
&
rc_old
,
&
rc
),
"rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)
\n
"
,
rc_old
.
left
,
rc_old
.
top
,
rc_old
.
right
,
rc_old
.
bottom
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
DestroyWindow
(
popup
);
DestroyWindow
(
child
);
DestroyWindow
(
parent1
);
DestroyWindow
(
parent2
);
flush_sequence
();
}
START_TEST
(
msg
)
{
char
**
test_argv
;
...
...
@@ -12727,6 +12847,7 @@ START_TEST(msg)
hEvent_hook
=
0
;
#endif
test_SetParent
();
test_PostMessage
();
test_ShowWindow
();
test_PeekMessage
();
...
...
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