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
2429ef90
Commit
2429ef90
authored
Nov 15, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Dialog creation code should force WS_CHILD style for dialog controls.
parent
50d37fe0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
dialog.c
dlls/user32/dialog.c
+3
-1
dialog.c
dlls/user32/tests/dialog.c
+41
-0
resource.rc
dlls/user32/tests/resource.rc
+10
-0
No files found.
dlls/user32/dialog.c
View file @
2429ef90
...
...
@@ -263,7 +263,9 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
{
template
=
(
LPCSTR
)
DIALOG_GetControl32
(
(
const
WORD
*
)
template
,
&
info
,
dlgTemplate
->
dialogEx
);
/* Is this it? */
info
.
style
&=
~
WS_POPUP
;
info
.
style
|=
WS_CHILD
;
if
(
info
.
style
&
WS_BORDER
)
{
info
.
style
&=
~
WS_BORDER
;
...
...
dlls/user32/tests/dialog.c
View file @
2429ef90
...
...
@@ -33,6 +33,8 @@
#include <stdio.h>
#include <stdarg.h>
#define WINVER 0x0600
/* For NONCLIENTMETRICS with padding */
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
...
...
@@ -1058,11 +1060,50 @@ static INT_PTR CALLBACK TestReturnKeyDlgProc (HWND hDlg, UINT uiMsg,
return
FALSE
;
}
static
INT_PTR
CALLBACK
TestControlStyleDlgProc
(
HWND
hdlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
HWND
control
;
DWORD
style
,
exstyle
;
char
buf
[
256
];
switch
(
msg
)
{
case
WM_INITDIALOG
:
control
=
GetDlgItem
(
hdlg
,
7
);
ok
(
control
!=
0
,
"dialog control with id 7 not found
\n
"
);
style
=
GetWindowLong
(
control
,
GWL_STYLE
);
ok
(
style
==
(
WS_CHILD
|
WS_VISIBLE
),
"expected WS_CHILD|WS_VISIBLE, got %#x
\n
"
,
style
);
exstyle
=
GetWindowLong
(
control
,
GWL_EXSTYLE
);
ok
(
exstyle
==
(
WS_EX_NOPARENTNOTIFY
|
WS_EX_TRANSPARENT
|
WS_EX_CLIENTEDGE
),
"expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE, got %#x
\n
"
,
exstyle
);
buf
[
0
]
=
0
;
GetWindowText
(
control
,
buf
,
sizeof
(
buf
));
ok
(
lstrcmp
(
buf
,
"bump7"
)
==
0
,
"expected bump7, got %s
\n
"
,
buf
);
control
=
GetDlgItem
(
hdlg
,
8
);
ok
(
control
!=
0
,
"dialog control with id 8 not found
\n
"
);
style
=
GetWindowLong
(
control
,
GWL_STYLE
);
ok
(
style
==
(
WS_CHILD
|
WS_VISIBLE
),
"expected WS_CHILD|WS_VISIBLE, got %#x
\n
"
,
style
);
exstyle
=
GetWindowLong
(
control
,
GWL_EXSTYLE
);
ok
(
exstyle
==
(
WS_EX_NOPARENTNOTIFY
|
WS_EX_TRANSPARENT
),
"expected WS_EX_NOPARENTNOTIFY|WS_EX_TRANSPARENT, got %#x
\n
"
,
exstyle
);
buf
[
0
]
=
0
;
GetWindowText
(
control
,
buf
,
sizeof
(
buf
));
ok
(
lstrcmp
(
buf
,
"bump8"
)
==
0
,
"expected bump8, got %s
\n
"
,
buf
);
EndDialog
(
hdlg
,
-
7
);
return
TRUE
;
}
return
FALSE
;
}
static
void
test_DialogBoxParamA
(
void
)
{
INT_PTR
ret
;
HWND
hwnd_invalid
=
(
HWND
)
0x4444
;
ret
=
DialogBoxParamA
(
GetModuleHandle
(
0
),
"TEST_DLG_CHILD_POPUP"
,
0
,
TestControlStyleDlgProc
,
0
);
ok
(
ret
==
-
7
,
"expected -7, got %ld
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
DialogBoxParamA
(
GetModuleHandle
(
NULL
),
"IDD_DIALOG"
,
hwnd_invalid
,
0
,
0
);
ok
(
0
==
ret
||
broken
(
ret
==
-
1
),
"DialogBoxParamA returned %ld, expected 0
\n
"
,
ret
);
...
...
dlls/user32/tests/resource.rc
View file @
2429ef90
...
...
@@ -45,6 +45,16 @@ STRINGTABLE
65534 "Test high id"
}
/* Test dialog with a mixed style WS_CHILD | WS_POPUP control */
TEST_DLG_CHILD_POPUP DIALOG 0, 0, 60, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test dialog with mixed style controls"
FONT 8, "MS Shell Dlg"
{
CONTROL "bump7",7,"static",WS_CHILD|WS_POPUP|WS_BORDER,0,0,40,10,WS_EX_TRANSPARENT
CONTROL "bump8",8,"static",WS_POPUP,0,10,40,10,WS_EX_TRANSPARENT
}
TEST_DIALOG DIALOG 0, 0, 60, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Test dialog"
...
...
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