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
c3cecc5d
Commit
c3cecc5d
authored
Oct 11, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- WM_MDISETMENU handler should update new frame menu only if an active
and maximized MDI child is visible. - Add a test case for MDI child activation sequence.
parent
ee83c727
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
15 deletions
+68
-15
msg.c
dlls/user/tests/msg.c
+15
-1
win.c
dlls/user/tests/win.c
+51
-12
mdi.c
windows/mdi.c
+2
-2
No files found.
dlls/user/tests/msg.c
View file @
c3cecc5d
...
@@ -1556,7 +1556,8 @@ static LRESULT WINAPI mdi_client_hook_proc(HWND hwnd, UINT message, WPARAM wPara
...
@@ -1556,7 +1556,8 @@ static LRESULT WINAPI mdi_client_hook_proc(HWND hwnd, UINT message, WPARAM wPara
if
(
message
!=
WM_PAINT
&&
if
(
message
!=
WM_PAINT
&&
message
!=
WM_ERASEBKGND
&&
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCPAINT
&&
message
!=
WM_NCPAINT
&&
message
!=
WM_GETTEXT
)
message
!=
WM_GETTEXT
&&
message
!=
WM_MDIGETACTIVE
)
{
{
trace
(
"mdi client: %p, %04x, %08x, %08lx
\n
"
,
hwnd
,
message
,
wParam
,
lParam
);
trace
(
"mdi client: %p, %04x, %08x, %08lx
\n
"
,
hwnd
,
message
,
wParam
,
lParam
);
...
@@ -1622,6 +1623,19 @@ static LRESULT WINAPI mdi_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam,
...
@@ -1622,6 +1623,19 @@ static LRESULT WINAPI mdi_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam,
wParam
=
winpos
->
flags
&
0xffff
;
wParam
=
winpos
->
flags
&
0xffff
;
break
;
break
;
}
}
case
WM_MDIACTIVATE
:
{
HWND
active
,
client
=
GetParent
(
hwnd
);
active
=
(
HWND
)
SendMessageA
(
client
,
WM_MDIGETACTIVE
,
0
,
0
);
if
(
hwnd
==
(
HWND
)
lParam
)
/* if we are being activated */
ok
(
active
==
(
HWND
)
lParam
,
"new active %p != active %p
\n
"
,
(
HWND
)
lParam
,
active
);
else
ok
(
active
==
(
HWND
)
wParam
,
"old active %p != active %p
\n
"
,
(
HWND
)
wParam
,
active
);
break
;
}
}
}
msg
.
message
=
message
;
msg
.
message
=
message
;
...
...
dlls/user/tests/win.c
View file @
c3cecc5d
...
@@ -947,22 +947,27 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -947,22 +947,27 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
mdi_cs
.
lParam
=
(
LPARAM
)
mdi_lParam_test_message
;
mdi_cs
.
lParam
=
(
LPARAM
)
mdi_lParam_test_message
;
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_cs
.
style
=
0x7fffffff
;
/* without WS_POPUP */
mdi_cs
.
style
=
0x7fffffff
;
/* without WS_POPUP */
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_cs
.
style
=
0xffffffff
;
/* with WS_POPUP */
mdi_cs
.
style
=
0xffffffff
;
/* with WS_POPUP */
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
mdi_child
=
(
HWND
)
SendMessageA
(
mdi_client
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
mdi_cs
);
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
{
{
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
DestroyWindow
(
mdi_child
);
}
}
else
else
{
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
/* test MDICREATESTRUCT A<->W mapping */
/* test MDICREATESTRUCT A<->W mapping */
/* MDICREATESTRUCTA and MDICREATESTRUCTW have the same layout */
/* MDICREATESTRUCTA and MDICREATESTRUCTW have the same layout */
...
@@ -978,7 +983,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -978,7 +983,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
else
else
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
}
}
DestroyWindow
(
mdi_child
);
else
{
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
0
,
0
,
...
@@ -987,7 +996,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -987,7 +996,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
mdi_client
,
GetModuleHandle
(
0
),
mdi_client
,
GetModuleHandle
(
0
),
(
LPARAM
)
mdi_lParam_test_message
);
(
LPARAM
)
mdi_lParam_test_message
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
0x7fffffff
,
/* without WS_POPUP */
0x7fffffff
,
/* without WS_POPUP */
...
@@ -996,7 +1006,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -996,7 +1006,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
mdi_client
,
GetModuleHandle
(
0
),
mdi_client
,
GetModuleHandle
(
0
),
(
LPARAM
)
mdi_lParam_test_message
);
(
LPARAM
)
mdi_lParam_test_message
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateMDIWindowA
(
"MDI_child_Class_1"
,
"MDI child"
,
0xffffffff
,
/* with WS_POPUP */
0xffffffff
,
/* with WS_POPUP */
...
@@ -1007,10 +1018,13 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1007,10 +1018,13 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
{
{
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
DestroyWindow
(
mdi_child
);
}
}
else
else
{
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
/* test MDICREATESTRUCT A<->W mapping */
/* test MDICREATESTRUCT A<->W mapping */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1027,7 +1041,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1027,7 +1041,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
else
else
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
}
}
DestroyWindow
(
mdi_child
);
else
{
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
0
,
0
,
...
@@ -1036,7 +1054,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1036,7 +1054,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
mdi_client
,
0
,
GetModuleHandle
(
0
),
mdi_client
,
0
,
GetModuleHandle
(
0
),
(
LPVOID
)
mdi_lParam_test_message
);
(
LPVOID
)
mdi_lParam_test_message
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
0x7fffffff
,
/* without WS_POPUP */
0x7fffffff
,
/* without WS_POPUP */
...
@@ -1045,7 +1064,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1045,7 +1064,8 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
mdi_client
,
0
,
GetModuleHandle
(
0
),
mdi_client
,
0
,
GetModuleHandle
(
0
),
(
LPVOID
)
mdi_lParam_test_message
);
(
LPVOID
)
mdi_lParam_test_message
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
DestroyWindow
(
mdi_child
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
mdi_child
=
CreateWindowExA
(
WS_EX_MDICHILD
,
"MDI_child_Class_1"
,
"MDI child"
,
0xffffffff
,
/* with WS_POPUP */
0xffffffff
,
/* with WS_POPUP */
...
@@ -1056,10 +1076,13 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1056,10 +1076,13 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
if
(
GetWindowLongA
(
mdi_client
,
GWL_STYLE
)
&
MDIS_ALLCHILDSTYLES
)
{
{
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
ok
(
!
mdi_child
,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail
\n
"
);
DestroyWindow
(
mdi_child
);
}
}
else
else
{
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
/* test MDICREATESTRUCT A<->W mapping */
/* test MDICREATESTRUCT A<->W mapping */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1076,7 +1099,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
...
@@ -1076,7 +1099,11 @@ static void test_MDI_create(HWND parent, HWND mdi_client)
else
else
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
ok
(
mdi_child
!=
0
,
"MDI child creation failed
\n
"
);
}
}
DestroyWindow
(
mdi_child
);
else
{
SendMessageA
(
mdi_client
,
WM_MDIDESTROY
,
(
WPARAM
)
mdi_child
,
0
);
ok
(
!
IsWindow
(
mdi_child
),
"WM_MDIDESTROY failed
\n
"
);
}
/* This test fails on Win9x */
/* This test fails on Win9x */
if
(
!
isWin9x
)
if
(
!
isWin9x
)
...
@@ -1282,6 +1309,18 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
...
@@ -1282,6 +1309,18 @@ static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, L
return
1
;
return
1
;
}
}
case
WM_MDIACTIVATE
:
{
HWND
active
,
client
=
GetParent
(
hwnd
);
/*trace("%p WM_MDIACTIVATE %08x %08lx\n", hwnd, wparam, lparam);*/
active
=
(
HWND
)
SendMessageA
(
client
,
WM_MDIGETACTIVE
,
0
,
0
);
if
(
hwnd
==
(
HWND
)
lparam
)
/* if we are being activated */
ok
(
active
==
(
HWND
)
lparam
,
"new active %p != active %p
\n
"
,
(
HWND
)
lparam
,
active
);
else
ok
(
active
==
(
HWND
)
wparam
,
"old active %p != active %p
\n
"
,
(
HWND
)
wparam
,
active
);
break
;
}
}
}
return
DefMDIChildProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
return
DefMDIChildProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
}
}
...
...
windows/mdi.c
View file @
c3cecc5d
...
@@ -300,7 +300,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
...
@@ -300,7 +300,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
{
{
if
(
hmenuFrame
==
ci
->
hFrameMenu
)
return
(
LRESULT
)
hmenuFrame
;
if
(
hmenuFrame
==
ci
->
hFrameMenu
)
return
(
LRESULT
)
hmenuFrame
;
if
(
IsZoomed
(
ci
->
hwndActiveChild
)
&&
hmenuFrame
!=
ci
->
hFrameMenu
)
if
(
IsZoomed
(
ci
->
hwndActiveChild
)
)
MDI_RestoreFrameMenu
(
hwndFrame
,
ci
->
hwndActiveChild
);
MDI_RestoreFrameMenu
(
hwndFrame
,
ci
->
hwndActiveChild
);
}
}
...
@@ -335,7 +335,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
...
@@ -335,7 +335,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
HMENU
oldFrameMenu
=
ci
->
hFrameMenu
;
HMENU
oldFrameMenu
=
ci
->
hFrameMenu
;
ci
->
hFrameMenu
=
hmenuFrame
;
ci
->
hFrameMenu
=
hmenuFrame
;
if
(
IsZoomed
(
ci
->
hwndActiveChild
)
)
if
(
IsZoomed
(
ci
->
hwndActiveChild
)
&&
(
GetWindowLongW
(
ci
->
hwndActiveChild
,
GWL_STYLE
)
&
WS_VISIBLE
)
)
MDI_AugmentFrameMenu
(
hwndFrame
,
ci
->
hwndActiveChild
);
MDI_AugmentFrameMenu
(
hwndFrame
,
ci
->
hwndActiveChild
);
return
(
LRESULT
)
oldFrameMenu
;
return
(
LRESULT
)
oldFrameMenu
;
...
...
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