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
93dd39a3
Commit
93dd39a3
authored
Aug 26, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 26, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Button should send BM_SETSTATE message after it has changed its
internal state.
parent
ce4dfe23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
button.c
controls/button.c
+1
-1
msg.c
dlls/user/tests/msg.c
+37
-1
No files found.
controls/button.c
View file @
93dd39a3
...
...
@@ -256,8 +256,8 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
case
WM_LBUTTONDOWN
:
SetCapture
(
hWnd
);
SetFocus
(
hWnd
);
SendMessageW
(
hWnd
,
BM_SETSTATE
,
TRUE
,
0
);
set_button_state
(
hWnd
,
get_button_state
(
hWnd
)
|
BUTTON_BTNPRESSED
);
SendMessageW
(
hWnd
,
BM_SETSTATE
,
TRUE
,
0
);
break
;
case
WM_KEYUP
:
...
...
dlls/user/tests/msg.c
View file @
93dd39a3
...
...
@@ -1670,6 +1670,25 @@ static const struct message WmKillFocusStaticSeq[] =
{
WM_IME_SETCONTEXT
,
sent
|
wparam
|
optional
,
0
},
{
0
}
};
static
const
struct
message
WmLButtonDownSeq
[]
=
{
{
WM_LBUTTONDOWN
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
HCBT_SETFOCUS
,
hook
},
{
WM_IME_SETCONTEXT
,
sent
|
wparam
|
defwinproc
|
optional
,
1
},
{
WM_SETFOCUS
,
sent
|
wparam
|
defwinproc
,
0
},
{
WM_CTLCOLORBTN
,
sent
|
defwinproc
},
{
BM_SETSTATE
,
sent
|
wparam
|
defwinproc
,
TRUE
},
{
WM_CTLCOLORBTN
,
sent
|
defwinproc
},
{
0
}
};
static
const
struct
message
WmLButtonUpSeq
[]
=
{
{
WM_LBUTTONUP
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
BM_SETSTATE
,
sent
|
wparam
|
defwinproc
,
FALSE
},
{
WM_CTLCOLORBTN
,
sent
|
defwinproc
},
{
WM_CAPTURECHANGED
,
sent
|
wparam
|
defwinproc
,
0
},
{
0
}
};
static
WNDPROC
old_button_proc
;
...
...
@@ -1679,7 +1698,7 @@ static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam,
LRESULT
ret
;
struct
message
msg
;
trace
(
"%p, %04x, %08x, %08lx
\n
"
,
hwnd
,
message
,
wParam
,
lParam
);
trace
(
"
button:
%p, %04x, %08x, %08lx
\n
"
,
hwnd
,
message
,
wParam
,
lParam
);
msg
.
message
=
message
;
msg
.
flags
=
sent
|
wparam
|
lparam
;
...
...
@@ -1688,6 +1707,9 @@ static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam,
msg
.
lParam
=
lParam
;
add_message
(
&
msg
);
if
(
message
==
BM_SETSTATE
)
ok
(
GetCapture
()
==
hwnd
,
"GetCapture() = %p
\n
"
,
GetCapture
());
defwndproc_counter
++
;
ret
=
CallWindowProcA
(
old_button_proc
,
hwnd
,
message
,
wParam
,
lParam
);
defwndproc_counter
--
;
...
...
@@ -1754,6 +1776,20 @@ static void test_button_messages(void)
DestroyWindow
(
hwnd
);
}
hwnd
=
CreateWindowExA
(
0
,
"my_button_class"
,
"test"
,
button
[
i
].
style
|
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
50
,
14
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"Failed to create button window
\n
"
);
SetFocus
(
0
);
flush_sequence
();
SendMessageA
(
hwnd
,
WM_LBUTTONDOWN
,
0
,
0
);
ok_sequence
(
WmLButtonDownSeq
,
"WM_LBUTTONDOWN on a button"
,
FALSE
);
SendMessageA
(
hwnd
,
WM_LBUTTONUP
,
0
,
0
);
ok_sequence
(
WmLButtonUpSeq
,
"WM_LBUTTONDOWN on a button"
,
FALSE
);
DestroyWindow
(
hwnd
);
}
/************* painting message 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