mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 08:20:27 +00:00
[UXTHEME][NTUSER] Check class style for CS_NOCLOSE instead of window style (#7130)
CORE-11569, CORE-19684 Addendum to commit71bed0f5f8
(PR #7123). The problem in uxtheme was introduced in commit685084b63c
(as part of a fix for CORE-17203), because it was a copy-paste and adaptation of the corresponding code in `ntuser/nonclient.c!NC_DoButton()`. The bugs in `win32ss/user/ntuser/defwnd.c` (and `nonclient.c` as fixed by the previous commit) were in turn introduced from the migration of menu and related code from user32 to win32k, see commit6dfa71c487
(r68904).
This commit is contained in:
parent
957bb89548
commit
c02289a08a
2 changed files with 2 additions and 2 deletions
|
@ -297,7 +297,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
|
|||
case CLOSEBUTTON:
|
||||
SysMenu = GetSystemMenu(pcontext->hWnd, FALSE);
|
||||
MenuState = GetMenuState(SysMenu, SC_CLOSE, MF_BYCOMMAND);
|
||||
if (!(pcontext->wi.dwStyle & WS_SYSMENU) || (MenuState & (MF_GRAYED | MF_DISABLED)) || pcontext->wi.dwStyle & CS_NOCLOSE)
|
||||
if (!(pcontext->wi.dwStyle & WS_SYSMENU) || (MenuState & (MF_GRAYED | MF_DISABLED)) || (GetClassLongPtrW(pcontext->hWnd, GCL_STYLE) & CS_NOCLOSE))
|
||||
{
|
||||
iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
|
||||
}
|
||||
|
|
|
@ -920,7 +920,7 @@ IntDefWindowProc(
|
|||
if (wParam == VK_F4) /* Try to close the window */
|
||||
{
|
||||
PWND top = UserGetAncestor(Wnd, GA_ROOT);
|
||||
if (!(top->style & CS_NOCLOSE))
|
||||
if (!(top->pcls->style & CS_NOCLOSE))
|
||||
UserPostMessage(UserHMGetHandle(top), WM_SYSCOMMAND, SC_CLOSE, 0);
|
||||
}
|
||||
else if (wParam == VK_SNAPSHOT) // Alt-VK_SNAPSHOT?
|
||||
|
|
Loading…
Reference in a new issue