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
41ea8f0e
Commit
41ea8f0e
authored
Mar 25, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Tweak how the edit control handles WM_GETDLGCODE.
parent
a1bc05e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
9 deletions
+110
-9
edit.c
dlls/user32/edit.c
+24
-9
edit.c
dlls/user32/tests/edit.c
+76
-0
resource.rc
dlls/user32/tests/resource.rc
+10
-0
No files found.
dlls/user32/edit.c
View file @
41ea8f0e
...
...
@@ -795,21 +795,36 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
result
=
DLGC_HASSETSEL
|
DLGC_WANTCHARS
|
DLGC_WANTARROWS
;
if
(
es
->
style
&
ES_MULTILINE
)
{
result
|=
DLGC_WANTALLKEYS
;
break
;
}
if
(
lParam
&&
(((
LPMSG
)
lParam
)
->
message
==
WM_KEYDOWN
))
{
int
vk
=
(
int
)((
LPMSG
)
lParam
)
->
wParam
;
if
(
es
->
hwndListBox
&&
(
vk
==
VK_RETURN
||
vk
==
VK_ESCAPE
))
{
if
(
SendMessageW
(
GetParent
(
hwnd
),
CB_GETDROPPEDSTATE
,
0
,
0
))
result
|=
DLGC_WANTMESSAGE
;
}
}
if
(
es
->
hwndListBox
)
{
if
(
vk
==
VK_RETURN
||
vk
==
VK_ESCAPE
)
if
(
SendMessageW
(
GetParent
(
hwnd
),
CB_GETDROPPEDSTATE
,
0
,
0
))
result
|=
DLGC_WANTMESSAGE
;
}
else
{
switch
(
vk
)
{
case
VK_RETURN
:
SendMessageW
(
GetParent
(
hwnd
),
WM_COMMAND
,
IDOK
,
(
LPARAM
)
GetDlgItem
(
GetParent
(
hwnd
),
IDOK
));
break
;
case
VK_ESCAPE
:
SendMessageW
(
GetParent
(
hwnd
),
WM_CLOSE
,
0
,
0
);
break
;
case
VK_TAB
:
SendMessageW
(
GetParent
(
hwnd
),
WM_NEXTDLGCTL
,
(
GetKeyState
(
VK_SHIFT
)
&
0x8000
),
0
);
break
;
default:
break
;
}
}
}
break
;
case
WM_IME_CHAR
:
...
...
dlls/user32/tests/edit.c
View file @
41ea8f0e
...
...
@@ -37,6 +37,70 @@ struct edit_notify {
static
struct
edit_notify
notifications
;
static
INT_PTR
CALLBACK
bug_11841_proc
(
HWND
hdlg
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
switch
(
msg
)
{
case
WM_INITDIALOG
:
{
SetFocus
(
GetDlgItem
(
hdlg
,
1000
));
switch
(
lparam
)
{
case
0
:
PostMessage
(
GetDlgItem
(
hdlg
,
1000
),
WM_KEYDOWN
,
0x1b
,
0x10001
);
break
;
case
1
:
PostMessage
(
GetDlgItem
(
hdlg
,
1000
),
WM_KEYDOWN
,
0xd
,
0x1c0001
);
break
;
case
2
:
PostMessage
(
GetDlgItem
(
hdlg
,
1000
),
WM_KEYDOWN
,
0x9
,
0xf0001
);
PostMessage
(
hdlg
,
WM_USER
,
0xdeadbeef
,
0xdeadbeef
);
break
;
default:
break
;
}
break
;
}
case
WM_COMMAND
:
if
(
HIWORD
(
wparam
)
!=
BN_CLICKED
)
break
;
switch
(
LOWORD
(
wparam
))
{
case
IDOK
:
EndDialog
(
hdlg
,
111
);
break
;
case
IDCANCEL
:
EndDialog
(
hdlg
,
222
);
break
;
default:
break
;
}
break
;
case
WM_USER
:
if
(
wparam
!=
0xdeadbeef
||
lparam
!=
0xdeadbeef
)
break
;
if
(
GetFocus
()
==
GetDlgItem
(
hdlg
,
IDOK
))
EndDialog
(
hdlg
,
444
);
else
EndDialog
(
hdlg
,
555
);
break
;
case
WM_CLOSE
:
EndDialog
(
hdlg
,
333
);
break
;
default:
break
;
}
return
FALSE
;
}
static
HINSTANCE
hinst
;
static
HWND
hwndET2
;
static
const
char
szEditTest2Class
[]
=
"EditTest2Class"
;
...
...
@@ -1134,6 +1198,17 @@ static void test_undo(void)
DestroyWindow
(
hwEdit
);
}
static
void
test_bug_11841
(
void
)
{
int
r
;
r
=
DialogBoxParam
(
hinst
,
"BUG_11841_DIALOG"
,
NULL
,
(
DLGPROC
)
bug_11841_proc
,
0
);
ok
(
333
==
r
,
"Expected %d, got %d
\n
"
,
333
,
r
);
r
=
DialogBoxParam
(
hinst
,
"BUG_11841_DIALOG"
,
NULL
,
(
DLGPROC
)
bug_11841_proc
,
1
);
ok
(
111
==
r
,
"Expected %d, got %d
\n
"
,
111
,
r
);
r
=
DialogBoxParam
(
hinst
,
"BUG_11841_DIALOG"
,
NULL
,
(
DLGPROC
)
bug_11841_proc
,
2
);
ok
(
444
==
r
,
"Expected %d, got %d
\n
"
,
444
,
r
);
}
static
BOOL
RegisterWindowClasses
(
void
)
{
WNDCLASSA
test2
;
...
...
@@ -1202,6 +1277,7 @@ START_TEST(edit)
test_text_position
();
test_espassword
();
test_undo
();
test_bug_11841
();
UnregisterWindowClasses
();
}
dlls/user32/tests/resource.rc
View file @
41ea8f0e
...
...
@@ -98,6 +98,16 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
BUG_11841_DIALOG DIALOG DISCARDABLE 0, 0, 160, 80
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_CENTER
CAPTION "Bug 11841 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 | ES_READONLY
}
/* @makedep: test_mono.bmp */
100 BITMAP test_mono.bmp
...
...
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