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
96d965f2
Commit
96d965f2
authored
Dec 23, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/comboex: Add test for internally sent Edit messages, remove corresponding comments.
parent
ecc89bf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
4 deletions
+88
-4
comboex.c
dlls/comctl32/comboex.c
+1
-4
comboex.c
dlls/comctl32/tests/comboex.c
+87
-0
No files found.
dlls/comctl32/comboex.c
View file @
96d965f2
...
...
@@ -451,10 +451,7 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr)
static
void
COMBOEX_SetEditText
(
const
COMBOEX_INFO
*
infoPtr
,
CBE_ITEMDATA
*
item
)
{
if
(
!
infoPtr
->
hwndEdit
)
return
;
/* native issues the following messages to the {Edit} control */
/* WM_SETTEXT (0,addr) */
/* EM_SETSEL32 (0,0) */
/* EM_SETSEL32 (0,-1) */
if
(
item
->
mask
&
CBEIF_TEXT
)
{
SendMessageW
(
infoPtr
->
hwndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
COMBOEX_GetText
(
infoPtr
,
item
));
SendMessageW
(
infoPtr
->
hwndEdit
,
EM_SETSEL
,
0
,
0
);
...
...
dlls/comctl32/tests/comboex.c
View file @
96d965f2
...
...
@@ -22,6 +22,14 @@
#include <commctrl.h>
#include "wine/test.h"
#include "msg.h"
#define EDITBOX_SEQ_INDEX 0
#define NUM_MSG_SEQUENCES 1
#define EDITBOX_ID 0
static
struct
msg_sequence
*
sequences
[
NUM_MSG_SEQUENCES
];
static
HWND
hComboExParentWnd
;
static
HINSTANCE
hMainHinst
;
...
...
@@ -70,6 +78,50 @@ static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
return
(
LONG
)
SendMessage
(
cbex
,
CBEM_GETITEM
,
0
,
(
LPARAM
)
cbItem
);
}
static
LRESULT
WINAPI
editbox_subclass_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WNDPROC
oldproc
=
(
WNDPROC
)
GetWindowLongPtrA
(
hwnd
,
GWLP_USERDATA
);
static
LONG
defwndproc_counter
=
0
;
LRESULT
ret
;
struct
message
msg
;
msg
.
message
=
message
;
msg
.
flags
=
sent
|
wparam
|
lparam
;
if
(
defwndproc_counter
)
msg
.
flags
|=
defwinproc
;
msg
.
wParam
=
wParam
;
msg
.
lParam
=
lParam
;
msg
.
id
=
EDITBOX_ID
;
if
(
message
!=
WM_PAINT
&&
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCPAINT
&&
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_GETICON
&&
message
!=
WM_DEVICECHANGE
)
{
add_message
(
sequences
,
EDITBOX_SEQ_INDEX
,
&
msg
);
}
defwndproc_counter
++
;
ret
=
CallWindowProcA
(
oldproc
,
hwnd
,
message
,
wParam
,
lParam
);
defwndproc_counter
--
;
return
ret
;
}
static
HWND
subclass_editbox
(
HWND
hwndComboEx
)
{
WNDPROC
oldproc
;
HWND
hwnd
;
hwnd
=
(
HWND
)
SendMessage
(
hwndComboEx
,
CBEM_GETEDITCONTROL
,
0
,
0
);
oldproc
=
(
WNDPROC
)
SetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
editbox_subclass_proc
);
SetWindowLongPtrA
(
hwnd
,
GWLP_USERDATA
,
(
LONG_PTR
)
oldproc
);
return
hwnd
;
}
static
void
test_comboboxex
(
void
)
{
HWND
myHwnd
=
0
;
LONG
res
=
-
1
;
...
...
@@ -414,15 +466,50 @@ static void test_comboboxex_subclass(void)
DestroyWindow
(
hComboEx
);
}
static
const
struct
message
test_setitem_edit_seq
[]
=
{
{
WM_SETTEXT
,
sent
|
id
,
0
,
0
,
EDITBOX_ID
},
{
EM_SETSEL
,
sent
|
id
|
wparam
|
lparam
,
0
,
0
,
EDITBOX_ID
},
{
EM_SETSEL
,
sent
|
id
|
wparam
|
lparam
,
0
,
-
1
,
EDITBOX_ID
},
{
0
}
};
static
void
test_get_set_item
(
void
)
{
char
textA
[]
=
"test"
;
HWND
hComboEx
;
COMBOBOXEXITEMA
item
;
BOOL
ret
;
hComboEx
=
createComboEx
(
WS_BORDER
|
WS_VISIBLE
|
WS_CHILD
|
CBS_DROPDOWN
);
subclass_editbox
(
hComboEx
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
memset
(
&
item
,
0
,
sizeof
(
item
));
item
.
mask
=
CBEIF_TEXT
;
item
.
pszText
=
textA
;
item
.
iItem
=
-
1
;
ret
=
SendMessage
(
hComboEx
,
CBEM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"CBEM_SETITEMA failed
\n
"
);
ok_sequence
(
sequences
,
EDITBOX_SEQ_INDEX
,
test_setitem_edit_seq
,
"set item data for edit"
,
FALSE
);
DestroyWindow
(
hComboEx
);
}
START_TEST
(
comboex
)
{
if
(
!
init
())
return
;
init_msg_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
test_comboboxex
();
test_WM_LBUTTONDOWN
();
test_CB_GETLBTEXT
();
test_comboboxex_subclass
();
test_get_set_item
();
cleanup
();
}
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