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
e6e15c36
Commit
e6e15c36
authored
Apr 27, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Before removing menu items in the MDI Window menu check whether a menu
item following a separator has our "magic" value.
parent
759aff6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
19 deletions
+35
-19
mdi.c
windows/mdi.c
+35
-19
No files found.
windows/mdi.c
View file @
e6e15c36
...
...
@@ -316,7 +316,6 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
/* Add items to the new Window menu */
ci
->
nActiveChildren
=
nActiveChildren_old
;
AppendMenuW
(
hmenuWindow
,
MF_SEPARATOR
,
0
,
NULL
);
MDI_RefreshMenu
(
ci
);
}
else
...
...
@@ -357,7 +356,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
*/
static
LRESULT
MDI_RefreshMenu
(
MDICLIENTINFO
*
ci
)
{
UINT
i
,
count
,
visible
,
separator_pos
;
UINT
i
,
count
,
visible
,
separator_pos
,
id
;
WCHAR
buf
[
MDI_MAXTITLELENGTH
];
TRACE
(
"children %u, window menu %p
\n
"
,
ci
->
nActiveChildren
,
ci
->
hWindowMenu
);
...
...
@@ -371,9 +370,11 @@ static LRESULT MDI_RefreshMenu(MDICLIENTINFO *ci)
return
0
;
}
/* Windows finds the last separator in the menu, removes all existing
/* Windows finds the last separator in the menu, and if after it
* there is a menu item with MDI magic ID removes all existing
* menu items after it, and then adds visible MDI children.
*/
id
=
(
UINT
)
-
1
;
separator_pos
=
0
;
count
=
GetMenuItemCount
(
ci
->
hWindowMenu
);
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -383,30 +384,43 @@ static LRESULT MDI_RefreshMenu(MDICLIENTINFO *ci)
memset
(
&
mii
,
0
,
sizeof
(
mii
));
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_TYPE
;
GetMenuItemInfoW
(
ci
->
hWindowMenu
,
i
,
TRUE
,
&
mii
);
if
(
mii
.
fType
&
MFT_SEPARATOR
)
separator_pos
=
i
;
if
(
GetMenuItemInfoW
(
ci
->
hWindowMenu
,
i
,
TRUE
,
&
mii
))
{
if
(
mii
.
fType
&
MF_SEPARATOR
)
{
separator_pos
=
i
;
/* Windows checks only ID of the menu item */
memset
(
&
mii
,
0
,
sizeof
(
mii
));
mii
.
cbSize
=
sizeof
(
mii
);
mii
.
fMask
=
MIIM_ID
;
if
(
GetMenuItemInfoW
(
ci
->
hWindowMenu
,
i
+
1
,
TRUE
,
&
mii
))
id
=
mii
.
wID
;
}
}
}
for
(
i
=
separator_pos
+
1
;
i
<
count
;
i
++
)
RemoveMenu
(
ci
->
hWindowMenu
,
separator_pos
+
1
,
MF_BYPOSITION
);
if
(
separator_pos
&&
id
==
ci
->
idFirstChild
)
{
for
(
i
=
separator_pos
;
i
<
count
;
i
++
)
RemoveMenu
(
ci
->
hWindowMenu
,
separator_pos
,
MF_BYPOSITION
);
}
visible
=
0
;
for
(
i
=
0
;
i
<
ci
->
nActiveChildren
;
i
++
)
{
UINT
id
=
ci
->
idFirstChild
+
i
;
if
(
visible
==
MDI_MOREWINDOWSLIMIT
)
{
LoadStringW
(
user32_module
,
IDS_MDI_MOREWINDOWS
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
AppendMenuW
(
ci
->
hWindowMenu
,
MF_STRING
,
id
,
buf
);
break
;
}
if
(
GetWindowLongW
(
ci
->
child
[
i
],
GWL_STYLE
)
&
WS_VISIBLE
)
{
if
(
!
visible
&&
!
separator_pos
)
id
=
ci
->
idFirstChild
+
visible
;
if
(
visible
==
MDI_MOREWINDOWSLIMIT
)
{
LoadStringW
(
user32_module
,
IDS_MDI_MOREWINDOWS
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
AppendMenuW
(
ci
->
hWindowMenu
,
MF_STRING
,
id
,
buf
);
break
;
}
if
(
!
visible
)
/* Visio expects that separator has id 0 */
AppendMenuW
(
ci
->
hWindowMenu
,
MF_SEPARATOR
,
0
,
NULL
);
...
...
@@ -1410,6 +1424,7 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
case
WM_SETFOCUS
:
case
WM_CHILDACTIVATE
:
case
WM_SYSCOMMAND
:
case
WM_SHOWWINDOW
:
case
WM_SETVISIBLE
:
case
WM_SIZE
:
case
WM_NEXTMENU
:
...
...
@@ -1488,6 +1503,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
}
break
;
case
WM_SHOWWINDOW
:
case
WM_SETVISIBLE
:
if
(
IsZoomed
(
ci
->
hwndActiveChild
))
ci
->
mdiFlags
&=
~
MDIF_NEEDUPDATE
;
else
MDI_PostUpdate
(
client
,
ci
,
SB_BOTH
+
1
);
...
...
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