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
bc07b2ac
Commit
bc07b2ac
authored
Jul 25, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take into account CS_NOCLOSE window class style and SC_CLOSE system
menu item state while adding MDI system menu buttons and generating WM_SYSCOMMAND messages.
parent
a726387a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
mdi.c
dlls/user/mdi.c
+29
-10
No files found.
dlls/user/mdi.c
View file @
bc07b2ac
...
...
@@ -200,6 +200,20 @@ static MDICLIENTINFO *get_client_info( HWND client )
return
ret
;
}
static
BOOL
is_close_enabled
(
HWND
hwnd
,
HMENU
hSysMenu
)
{
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_NOCLOSE
)
return
FALSE
;
if
(
!
hSysMenu
)
hSysMenu
=
GetSystemMenu
(
hwnd
,
FALSE
);
if
(
hSysMenu
)
{
UINT
state
=
GetMenuState
(
hSysMenu
,
SC_CLOSE
,
MF_BYCOMMAND
);
if
(
state
==
0xFFFFFFFF
||
(
state
&
(
MF_DISABLED
|
MF_GRAYED
)))
return
FALSE
;
}
return
TRUE
;
}
/**********************************************************************
* MDI_GetWindow
*
...
...
@@ -812,13 +826,13 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
if
(
!
(
hSysPopup
=
GetSystemMenu
(
hChild
,
FALSE
)))
return
0
;
AppendMenu
A
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_MINIMIZE
,
(
LPSTR
)(
DWORD
)
HBMMENU_MBAR_MINIMIZE
)
;
AppendMenu
A
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_RESTORE
,
(
LPSTR
)(
DWORD
)
HBMMENU_MBAR_RESTORE
);
AppendMenuA
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_CLOSE
,
(
LPSTR
)(
DWORD
)
HBMMENU_MBAR_CLOSE
);
AppendMenu
W
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_MINIMIZE
,
(
LPCWSTR
)
HBMMENU_MBAR_MINIMIZE
)
;
AppendMenu
W
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_RESTORE
,
(
LPCWSTR
)
HBMMENU_MBAR_RESTORE
);
AppendMenuW
(
menu
,
MF_HELP
|
MF_BITMAP
,
SC_CLOSE
,
is_close_enabled
(
hChild
,
hSysPopup
)
?
(
LPCWSTR
)
HBMMENU_MBAR_CLOSE
:
(
LPCWSTR
)
HBMMENU_MBAR_CLOSE_D
);
/* The system menu is replaced by the child icon */
hIcon
=
(
HICON
)
GetClassLongPtrW
(
hChild
,
GCLP_HICONSM
);
...
...
@@ -1306,13 +1320,14 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd, HWND hwndMDIClient,
if
(
!
IsZoomed
(
ci
->
hwndActiveChild
)
)
break
;
switch
(
id
)
{
case
SC_CLOSE
:
if
(
!
is_close_enabled
(
ci
->
hwndActiveChild
,
0
))
break
;
case
SC_SIZE
:
case
SC_MOVE
:
case
SC_MINIMIZE
:
case
SC_MAXIMIZE
:
case
SC_NEXTWINDOW
:
case
SC_PREVWINDOW
:
case
SC_CLOSE
:
case
SC_RESTORE
:
return
SendMessageW
(
ci
->
hwndActiveChild
,
WM_SYSCOMMAND
,
wParam
,
lParam
);
...
...
@@ -1617,8 +1632,12 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
break
;
case
VK_F4
:
case
VK_RBUTTON
:
wParam
=
SC_CLOSE
;
break
;
if
(
is_close_enabled
(
ci
->
hwndActiveChild
,
0
))
{
wParam
=
SC_CLOSE
;
break
;
}
/* fall through */
default:
return
0
;
}
...
...
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