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
d814bb65
Commit
d814bb65
authored
Jul 31, 1999
by
Pascal Lessard
Committed by
Alexandre Julliard
Jul 31, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the system button behavior and associated it to the system
menu in win95. Also permit the SC_CLOSE item to be disabled.
parent
1c08ac60
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletion
+35
-1
menu.c
controls/menu.c
+35
-1
nonclient.c
windows/nonclient.c
+0
-0
No files found.
controls/menu.c
View file @
d814bb65
...
@@ -75,6 +75,7 @@ typedef struct {
...
@@ -75,6 +75,7 @@ typedef struct {
HBRUSH
hbrBack
;
/* brush for menu background */
HBRUSH
hbrBack
;
/* brush for menu background */
DWORD
dwContextHelpID
;
DWORD
dwContextHelpID
;
DWORD
dwMenuData
;
/* application defined value */
DWORD
dwMenuData
;
/* application defined value */
HMENU
hSysMenuOwner
;
/* Handle to the dummy sys menu holder */
}
POPUPMENU
,
*
LPPOPUPMENU
;
}
POPUPMENU
,
*
LPPOPUPMENU
;
/* internal flags for menu tracking */
/* internal flags for menu tracking */
...
@@ -460,7 +461,10 @@ static void MENU_InitSysMenuPopup( HMENU hmenu, DWORD style, DWORD clsStyle )
...
@@ -460,7 +461,10 @@ static void MENU_InitSysMenuPopup( HMENU hmenu, DWORD style, DWORD clsStyle )
gray
=
!
(
style
&
(
WS_MAXIMIZE
|
WS_MINIMIZE
));
gray
=
!
(
style
&
(
WS_MAXIMIZE
|
WS_MINIMIZE
));
EnableMenuItem
(
hmenu
,
SC_RESTORE
,
(
gray
?
MF_GRAYED
:
MF_ENABLED
)
);
EnableMenuItem
(
hmenu
,
SC_RESTORE
,
(
gray
?
MF_GRAYED
:
MF_ENABLED
)
);
gray
=
(
clsStyle
&
CS_NOCLOSE
)
!=
0
;
gray
=
(
clsStyle
&
CS_NOCLOSE
)
!=
0
;
EnableMenuItem
(
hmenu
,
SC_CLOSE
,
(
gray
?
MF_GRAYED
:
MF_ENABLED
)
);
/* The menu item must keep its state if it's disabled */
if
(
gray
)
EnableMenuItem
(
hmenu
,
SC_CLOSE
,
MF_GRAYED
);
}
}
...
@@ -3191,15 +3195,39 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
...
@@ -3191,15 +3195,39 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
{
{
UINT
oldflags
;
UINT
oldflags
;
MENUITEM
*
item
;
MENUITEM
*
item
;
POPUPMENU
*
menu
;
TRACE
(
"(%04x, %04X, %04X) !
\n
"
,
TRACE
(
"(%04x, %04X, %04X) !
\n
"
,
hMenu
,
wItemID
,
wFlags
);
hMenu
,
wItemID
,
wFlags
);
/* Get the Popupmenu to access the owner menu */
if
(
!
(
menu
=
(
POPUPMENU
*
)
USER_HEAP_LIN_ADDR
(
hMenu
)))
return
(
UINT
)
-
1
;
if
(
!
(
item
=
MENU_FindItem
(
&
hMenu
,
&
wItemID
,
wFlags
)))
if
(
!
(
item
=
MENU_FindItem
(
&
hMenu
,
&
wItemID
,
wFlags
)))
return
(
UINT
)
-
1
;
return
(
UINT
)
-
1
;
oldflags
=
item
->
fState
&
(
MF_GRAYED
|
MF_DISABLED
);
oldflags
=
item
->
fState
&
(
MF_GRAYED
|
MF_DISABLED
);
item
->
fState
^=
(
oldflags
^
wFlags
)
&
(
MF_GRAYED
|
MF_DISABLED
);
item
->
fState
^=
(
oldflags
^
wFlags
)
&
(
MF_GRAYED
|
MF_DISABLED
);
/* In win95 if the close item in the system menu change update the close button */
if
(
TWEAK_WineLook
==
WIN95_LOOK
)
if
((
item
->
wID
==
SC_CLOSE
)
&&
(
oldflags
!=
wFlags
))
{
if
(
menu
->
hSysMenuOwner
!=
0
)
{
POPUPMENU
*
parentMenu
;
/* Get the parent menu to access*/
if
(
!
(
parentMenu
=
(
POPUPMENU
*
)
USER_HEAP_LIN_ADDR
(
menu
->
hSysMenuOwner
)))
return
(
UINT
)
-
1
;
/* Refresh the frame to reflect the change*/
SetWindowPos
(
parentMenu
->
hWnd
,
0
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOZORDER
);
}
}
return
oldflags
;
return
oldflags
;
}
}
...
@@ -3777,6 +3805,12 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
...
@@ -3777,6 +3805,12 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
if
(
wndPtr
->
hSysMenu
)
if
(
wndPtr
->
hSysMenu
)
{
{
HMENU
retvalue
=
GetSubMenu16
(
wndPtr
->
hSysMenu
,
0
);
HMENU
retvalue
=
GetSubMenu16
(
wndPtr
->
hSysMenu
,
0
);
/* Store the dummy sysmenu handle to facilitate the refresh */
/* of the close button if the SC_CLOSE item change */
POPUPMENU
*
menu
=
(
POPUPMENU
*
)
USER_HEAP_LIN_ADDR
(
retvalue
);
menu
->
hSysMenuOwner
=
wndPtr
->
hSysMenu
;
WIN_ReleaseWndPtr
(
wndPtr
);
WIN_ReleaseWndPtr
(
wndPtr
);
return
retvalue
;
return
retvalue
;
}
}
...
...
windows/nonclient.c
View file @
d814bb65
This diff is collapsed.
Click to expand it.
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