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
5d6bf737
Commit
5d6bf737
authored
Mar 27, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Mar 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add more dialog with edit control tests.
parent
15602032
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
6 deletions
+113
-6
edit.c
dlls/user32/tests/edit.c
+103
-6
resource.rc
dlls/user32/tests/resource.rc
+10
-0
No files found.
dlls/user32/tests/edit.c
View file @
5d6bf737
...
...
@@ -47,6 +47,7 @@ static INT_PTR CALLBACK edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPA
SetFocus
(
hedit
);
switch
(
lparam
)
{
/* from bug 11841 */
case
0
:
PostMessage
(
hedit
,
WM_KEYDOWN
,
VK_ESCAPE
,
0x10001
);
break
;
...
...
@@ -55,8 +56,40 @@ static INT_PTR CALLBACK edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPA
break
;
case
2
:
PostMessage
(
hedit
,
WM_KEYDOWN
,
VK_TAB
,
0xf0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0xdeadbeef
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
1
);
break
;
/* more test cases for WM_CHAR */
case
3
:
PostMessage
(
hedit
,
WM_CHAR
,
VK_ESCAPE
,
0x10001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0
);
break
;
case
4
:
PostMessage
(
hedit
,
WM_CHAR
,
VK_RETURN
,
0x1c0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0
);
break
;
case
5
:
PostMessage
(
hedit
,
WM_CHAR
,
VK_TAB
,
0xf0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0
);
break
;
/* more test cases for WM_KEYDOWN + WM_CHAR */
case
6
:
PostMessage
(
hedit
,
WM_KEYDOWN
,
VK_ESCAPE
,
0x10001
);
PostMessage
(
hedit
,
WM_CHAR
,
VK_ESCAPE
,
0x10001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0
);
break
;
case
7
:
PostMessage
(
hedit
,
WM_KEYDOWN
,
VK_RETURN
,
0x1c0001
);
PostMessage
(
hedit
,
WM_CHAR
,
VK_RETURN
,
0x1c0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
1
);
break
;
case
8
:
PostMessage
(
hedit
,
WM_KEYDOWN
,
VK_TAB
,
0xf0001
);
PostMessage
(
hedit
,
WM_CHAR
,
VK_TAB
,
0xf0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
1
);
break
;
default:
break
;
}
...
...
@@ -83,13 +116,37 @@ static INT_PTR CALLBACK edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPA
break
;
case
WM_USER
:
if
(
wparam
!=
0xdeadbeef
||
lparam
!=
0xdeadbeef
)
{
int
len
;
HWND
hok
=
GetDlgItem
(
hdlg
,
IDOK
);
HWND
hedit
=
GetDlgItem
(
hdlg
,
1000
);
if
(
wparam
!=
0xdeadbeef
)
break
;
if
(
GetFocus
()
==
GetDlgItem
(
hdlg
,
IDOK
))
EndDialog
(
hdlg
,
444
);
else
EndDialog
(
hdlg
,
555
);
switch
(
lparam
)
{
case
0
:
len
=
SendMessage
(
hedit
,
WM_GETTEXTLENGTH
,
0
,
0
);
if
(
len
==
0
)
EndDialog
(
hdlg
,
444
);
else
EndDialog
(
hdlg
,
555
);
break
;
case
1
:
len
=
SendMessage
(
hedit
,
WM_GETTEXTLENGTH
,
0
,
0
);
if
((
GetFocus
()
==
hok
)
&&
len
==
0
)
EndDialog
(
hdlg
,
444
);
else
EndDialog
(
hdlg
,
555
);
break
;
default:
EndDialog
(
hdlg
,
555
);
}
break
;
}
case
WM_CLOSE
:
EndDialog
(
hdlg
,
333
);
...
...
@@ -1210,6 +1267,46 @@ static void test_edit_dialog(void)
ok
(
111
==
r
,
"Expected %d, got %d
\n
"
,
111
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
2
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
/* more tests for WM_CHAR */
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
3
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
4
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
5
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
/* more tests for WM_KEYDOWN + WM_CHAR */
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
6
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
7
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_READONLY_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
8
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
/* tests with an editable edit control */
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
0
);
ok
(
333
==
r
,
"Expected %d, got %d
\n
"
,
333
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
1
);
ok
(
111
==
r
,
"Expected %d, got %d
\n
"
,
111
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
2
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
/* tests for WM_CHAR */
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
3
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
4
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
5
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
/* tests for WM_KEYDOWN + WM_CHAR */
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
6
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
7
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
r
=
DialogBoxParam
(
hinst
,
"EDIT_DIALOG"
,
NULL
,
(
DLGPROC
)
edit_dialog_proc
,
8
);
todo_wine
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
}
static
BOOL
RegisterWindowClasses
(
void
)
...
...
dlls/user32/tests/resource.rc
View file @
5d6bf737
...
...
@@ -98,6 +98,16 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
EDIT_DIALOG DIALOG DISCARDABLE 0, 0, 160, 80
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_CENTER
CAPTION "Edit Test"
FONT 8, "MS Shell Dlg"
{
PUSHBUTTON "Ok", IDOK, 20, 60, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 100, 60, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
EDITTEXT 1000, 5, 5, 150, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL
}
EDIT_READONLY_DIALOG DIALOG DISCARDABLE 0, 0, 160, 80
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_CENTER
CAPTION "Edit Readonly Test"
...
...
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