[NTUSER] Check class style for CS_NOCLOSE instead of window style (#7123)

Change 'pWnd->style' to 'pWnd->pcls->style' to check for CS_NOCLOSE.
Incorrect struct field was used for checking previously.

Fixes a bug with Ad Muncher that did not close when clicking on the window
title "X" button while being used with a Classic window style theme.
Patch by I_Kill_Bugs. CORE-11569
This commit is contained in:
Doug Lyons 2024-07-10 05:30:53 -05:00 committed by GitHub
parent 736d81938a
commit 71bed0f5f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1478,7 +1478,7 @@ NC_DoButton(PWND pWnd, WPARAM wParam, LPARAM lParam)
case HTCLOSE:
SysMenu = IntGetSystemMenu(pWnd, FALSE);
MenuState = IntGetMenuState(SysMenu ? UserHMGetHandle(SysMenu) : NULL, SC_CLOSE, MF_BYCOMMAND); /* in case of error MenuState==0xFFFFFFFF */
if (!(Style & WS_SYSMENU) || (MenuState & (MF_GRAYED|MF_DISABLED)) || (pWnd->style & CS_NOCLOSE))
if (!(Style & WS_SYSMENU) || (MenuState & (MF_GRAYED|MF_DISABLED)) || (pWnd->pcls->style & CS_NOCLOSE))
return;
ButtonType = DFCS_CAPTIONCLOSE;
SCMsg = SC_CLOSE;