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
a3528a76
Commit
a3528a76
authored
Jan 21, 2010
by
Peter Dons Tychsen
Committed by
Alexandre Julliard
Jan 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Handle WM_NOTIFY correctly when the parent returns zero.
parent
b3c38d3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
6 deletions
+90
-6
status.c
dlls/comctl32/status.c
+11
-6
status.c
dlls/comctl32/tests/status.c
+79
-0
No files found.
dlls/comctl32/status.c
View file @
a3528a76
...
...
@@ -1162,7 +1162,7 @@ STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
static
LRESULT
STATUSBAR_SendMouseNotify
(
const
STATUS_INFO
*
infoPtr
,
UINT
code
,
LPARAM
lParam
)
STATUSBAR_SendMouseNotify
(
const
STATUS_INFO
*
infoPtr
,
UINT
code
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
NMMOUSE
nm
;
...
...
@@ -1175,7 +1175,12 @@ STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, LPARAM lParam)
nm
.
dwItemSpec
=
STATUSBAR_InternalHitTest
(
infoPtr
,
&
nm
.
pt
);
nm
.
dwItemData
=
0
;
nm
.
dwHitInfo
=
0x30000
;
/* seems constant */
SendMessageW
(
infoPtr
->
Notify
,
WM_NOTIFY
,
0
,
(
LPARAM
)
&
nm
);
/* Do default processing if WM_NOTIFY returns zero */
if
(
!
SendMessageW
(
infoPtr
->
Notify
,
WM_NOTIFY
,
nm
.
hdr
.
idFrom
,
(
LPARAM
)
&
nm
))
{
return
DefWindowProcW
(
infoPtr
->
Self
,
msg
,
wParam
,
lParam
);
}
return
0
;
}
...
...
@@ -1276,10 +1281,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return
STATUSBAR_GetTextLength
(
infoPtr
,
0
);
case
WM_LBUTTONDBLCLK
:
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_DBLCLK
,
lParam
);
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_DBLCLK
,
msg
,
wParam
,
lParam
);
case
WM_LBUTTONUP
:
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_CLICK
,
lParam
);
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_CLICK
,
msg
,
wParam
,
lParam
);
case
WM_MOUSEMOVE
:
return
STATUSBAR_Relay2Tip
(
infoPtr
,
msg
,
wParam
,
lParam
);
...
...
@@ -1303,10 +1308,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return
STATUSBAR_WMPaint
(
infoPtr
,
(
HDC
)
wParam
);
case
WM_RBUTTONDBLCLK
:
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_RDBLCLK
,
lParam
);
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_RDBLCLK
,
msg
,
wParam
,
lParam
);
case
WM_RBUTTONUP
:
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_RCLICK
,
lParam
);
return
STATUSBAR_SendMouseNotify
(
infoPtr
,
NM_RCLICK
,
msg
,
wParam
,
lParam
);
case
WM_SETFONT
:
return
STATUSBAR_WMSetFont
(
infoPtr
,
(
HFONT
)
wParam
,
LOWORD
(
lParam
));
...
...
dlls/comctl32/tests/status.c
View file @
a3528a76
...
...
@@ -494,6 +494,84 @@ static void test_gettext(void)
DestroyWindow
(
hwndStatus
);
}
/* Notify events to parent */
static
BOOL
g_got_dblclk
;
static
BOOL
g_got_click
;
static
BOOL
g_got_rdblclk
;
static
BOOL
g_got_rclick
;
/* Messages to parent */
static
BOOL
g_got_contextmenu
;
static
LRESULT
WINAPI
test_notify_parent_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_NOTIFY
:
{
NMHDR
*
hdr
=
((
LPNMHDR
)
lParam
);
switch
(
hdr
->
code
)
{
case
NM_DBLCLK
:
g_got_dblclk
=
TRUE
;
break
;
case
NM_CLICK
:
g_got_click
=
TRUE
;
break
;
case
NM_RDBLCLK
:
g_got_rdblclk
=
TRUE
;
break
;
case
NM_RCLICK
:
g_got_rclick
=
TRUE
;
break
;
}
/* Return zero to indicate default processing */
return
0
;
}
case
WM_CONTEXTMENU
:
g_got_contextmenu
=
TRUE
;
return
0
;
default:
return
(
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
));
}
return
0
;
}
/* Test that WM_NOTIFY messages from the status control works correctly */
static
void
test_notify
(
void
)
{
HWND
hwndParent
;
HWND
hwndStatus
;
ATOM
atom
;
WNDCLASSA
wclass
=
{
0
};
wclass
.
lpszClassName
=
"TestNotifyParentClass"
;
wclass
.
lpfnWndProc
=
test_notify_parent_proc
;
atom
=
RegisterClassA
(
&
wclass
);
ok
(
atom
,
"RegisterClass failed!n"
);
/* create parent */
hwndParent
=
CreateWindow
(
wclass
.
lpszClassName
,
"parent"
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
0
,
300
,
20
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwndParent
!=
NULL
,
"Parent creation failed!
\n
"
);
/* create status bar */
hwndStatus
=
CreateWindow
(
STATUSCLASSNAME
,
NULL
,
WS_VISIBLE
|
WS_CHILD
,
0
,
0
,
300
,
20
,
hwndParent
,
NULL
,
NULL
,
NULL
);
ok
(
hwndStatus
!=
NULL
,
"Status creation failed!
\n
"
);
/* Send various mouse event, and check that we get them */
g_got_dblclk
=
FALSE
;
SendMessage
(
hwndStatus
,
WM_LBUTTONDBLCLK
,
0
,
0
);
ok
(
g_got_dblclk
,
"WM_LBUTTONDBLCLK was not processed correctly!
\n
"
);
g_got_rdblclk
=
FALSE
;
SendMessage
(
hwndStatus
,
WM_RBUTTONDBLCLK
,
0
,
0
);
ok
(
g_got_rdblclk
,
"WM_RBUTTONDBLCLK was not processed correctly!
\n
"
);
g_got_click
=
FALSE
;
SendMessage
(
hwndStatus
,
WM_LBUTTONUP
,
0
,
0
);
ok
(
g_got_click
,
"WM_LBUTTONUP was not processed correctly!
\n
"
);
/* For R-UP, check that we also get the context menu from the default processing */
g_got_contextmenu
=
FALSE
;
g_got_rclick
=
FALSE
;
SendMessage
(
hwndStatus
,
WM_RBUTTONUP
,
0
,
0
);
ok
(
g_got_rclick
,
"WM_RBUTTONUP was not processed correctly!
\n
"
);
ok
(
g_got_contextmenu
,
"WM_RBUTTONUP did not activate the context menu!
\n
"
);
}
START_TEST
(
status
)
{
hinst
=
GetModuleHandleA
(
NULL
);
...
...
@@ -512,4 +590,5 @@ START_TEST(status)
test_height
();
test_status_ownerdraw
();
test_gettext
();
test_notify
();
}
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