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
2f0b9dd3
Commit
2f0b9dd3
authored
Oct 19, 2010
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: FindWindow() should treat an empty title same way as NULL.
parent
b08d3d26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
win.c
dlls/user32/tests/win.c
+21
-3
win.c
dlls/user32/win.c
+8
-1
No files found.
dlls/user32/tests/win.c
View file @
2f0b9dd3
...
...
@@ -6239,15 +6239,31 @@ static void test_rtl_layout(void)
static
void
test_FindWindowEx
(
void
)
{
HWND
found
;
HWND
hwnd
,
found
;
CHAR
title
[
1
];
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
"caption"
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
title
[
0
]
=
0
;
found
=
FindWindowExA
(
0
,
0
,
"MainWindowClass"
,
title
);
ok
(
found
==
NULL
,
"expected a NULL hwnd
\n
"
);
found
=
FindWindowExA
(
0
,
0
,
"MainWindowClass"
,
NULL
);
ok
(
found
!=
NULL
,
"found is NULL, expected a valid hwnd
\n
"
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExA error %d
\n
"
,
GetLastError
()
);
found
=
FindWindowExA
(
0
,
0
,
"MainWindowClass"
,
title
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
found
=
FindWindowExA
(
0
,
0
,
"MainWindowClass"
,
NULL
);
ok
(
found
==
hwnd
,
"found is %p, expected a valid hwnd
\n
"
,
found
);
DestroyWindow
(
hwnd
);
/* test behaviour with a window title that is an empty character */
found
=
FindWindowExA
(
0
,
0
,
"Shell_TrayWnd"
,
title
);
todo_wine
...
...
@@ -6307,6 +6323,9 @@ START_TEST(win)
hhook
=
SetWindowsHookExA
(
WH_CBT
,
cbt_hook_proc
,
0
,
GetCurrentThreadId
());
if
(
!
hhook
)
win_skip
(
"Cannot set CBT hook, skipping some tests
\n
"
);
/* make sure that FindWindow tests are executed first */
test_FindWindowEx
();
hwndMain
=
CreateWindowExA
(
/*WS_EX_TOOLWINDOW*/
0
,
"MainWindowClass"
,
"Main window"
,
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
|
WS_POPUP
,
...
...
@@ -6374,7 +6393,6 @@ START_TEST(win)
test_Expose
();
test_layered_window
();
test_FindWindowEx
();
test_SetForegroundWindow
(
hwndMain
);
test_shell_window
();
test_handles
(
hwndMain
);
...
...
dlls/user32/win.c
View file @
2f0b9dd3
...
...
@@ -1767,7 +1767,14 @@ HWND WINAPI FindWindowExW( HWND parent, HWND child, LPCWSTR className, LPCWSTR t
{
while
(
list
[
i
])
{
if
(
GetWindowTextW
(
list
[
i
],
buffer
,
len
+
1
)
&&
!
strcmpiW
(
buffer
,
title
))
break
;
if
(
GetWindowTextW
(
list
[
i
],
buffer
,
len
+
1
))
{
if
(
!
strcmpiW
(
buffer
,
title
))
break
;
}
else
{
if
(
!
title
[
0
])
break
;
}
i
++
;
}
}
...
...
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