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
9b9dbb20
Commit
9b9dbb20
authored
Jun 25, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some more tests for HWND_MESSAGE windows.
parent
78240308
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
17 deletions
+41
-17
win.c
dlls/user32/tests/win.c
+41
-17
No files found.
dlls/user32/tests/win.c
View file @
9b9dbb20
...
...
@@ -4707,27 +4707,51 @@ static void test_GetWindowModuleFileName(void)
ok
(
!
ret1
,
"expected 0, got %u
\n
"
,
ret1
);
}
static
void
test_hwnd_message
(
void
)
{
HWND
parent
=
0
,
hwnd
;
RECT
rect
;
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
"message window"
,
WS_CAPTION
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
HWND_MESSAGE
,
0
,
0
,
NULL
);
if
(
!
hwnd
)
{
win_skip
(
"CreateWindowExA with parent HWND_MESSAGE failed
\n
"
);
return
;
}
ok
(
!
GetParent
(
hwnd
),
"GetParent should return 0 for message only windows
\n
"
);
if
(
pGetAncestor
)
{
char
buffer
[
100
];
HWND
root
,
desktop
=
GetDesktopWindow
();
parent
=
pGetAncestor
(
hwnd
,
GA_PARENT
);
ok
(
parent
!=
0
,
"GetAncestor(GA_PARENT) should not return 0 for message windows
\n
"
);
ok
(
parent
!=
desktop
,
"GetAncestor(GA_PARENT) should not return desktop for message windows
\n
"
);
root
=
pGetAncestor
(
hwnd
,
GA_ROOT
);
ok
(
root
==
hwnd
,
"GetAncestor(GA_ROOT) should return hwnd for message windows
\n
"
);
ok
(
!
pGetAncestor
(
parent
,
GA_PARENT
),
"parent shouldn't have a parent
\n
"
);
trace
(
"parent %p root %p desktop %p
\n
"
,
parent
,
root
,
desktop
);
if
(
!
GetClassNameA
(
parent
,
buffer
,
sizeof
(
buffer
)
))
buffer
[
0
]
=
0
;
ok
(
!
lstrcmpi
(
buffer
,
"Message"
),
"wrong parent class '%s'
\n
"
,
buffer
);
GetWindowRect
(
parent
,
&
rect
);
ok
(
rect
.
left
==
0
&&
rect
.
right
==
100
&&
rect
.
top
==
0
&&
rect
.
bottom
==
100
,
"wrong parent rect %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
}
GetWindowRect
(
hwnd
,
&
rect
);
ok
(
rect
.
left
==
100
&&
rect
.
right
==
300
&&
rect
.
top
==
100
&&
rect
.
bottom
==
300
,
"wrong window rect %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
win
)
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
pGetWindowInfo
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetWindowInfo"
);
pGetWindowModuleFileNameA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetWindowModuleFileNameA"
);
hwndMain
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
0
,
0
,
0
,
0
,
0
,
HWND_MESSAGE
,
0
,
0
,
NULL
);
if
(
hwndMain
)
{
ok
(
!
GetParent
(
hwndMain
),
"GetParent should return 0 for message only windows
\n
"
);
if
(
pGetAncestor
)
{
hwndMessage
=
pGetAncestor
(
hwndMain
,
GA_PARENT
);
ok
(
hwndMessage
!=
0
,
"GetAncestor(GA_PARENT) should not return 0 for message only windows
\n
"
);
trace
(
"hwndMessage %p
\n
"
,
hwndMessage
);
}
DestroyWindow
(
hwndMain
);
}
else
trace
(
"CreateWindowExA with parent HWND_MESSAGE failed
\n
"
);
if
(
!
RegisterWindowClasses
())
assert
(
0
);
hhook
=
SetWindowsHookExA
(
WH_CBT
,
cbt_hook_proc
,
0
,
GetCurrentThreadId
());
...
...
@@ -4738,8 +4762,6 @@ START_TEST(win)
WS_MAXIMIZEBOX
|
WS_POPUP
,
100
,
100
,
200
,
200
,
0
,
0
,
GetModuleHandle
(
0
),
NULL
);
test_nonclient_area
(
hwndMain
);
hwndMain2
=
CreateWindowExA
(
/*WS_EX_TOOLWINDOW*/
0
,
"MainWindowClass"
,
"Main window 2"
,
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
|
WS_POPUP
,
...
...
@@ -4751,6 +4773,8 @@ START_TEST(win)
our_pid
=
GetWindowThreadProcessId
(
hwndMain
,
NULL
);
/* Add the tests below this line */
test_hwnd_message
();
test_nonclient_area
(
hwndMain
);
test_params
();
test_GetWindowModuleFileName
();
test_capture_1
();
...
...
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