From 71bed0f5f8bcb225cac885de10476ad5687032dd Mon Sep 17 00:00:00 2001 From: Doug Lyons Date: Wed, 10 Jul 2024 05:30:53 -0500 Subject: [PATCH] [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 --- win32ss/user/ntuser/nonclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/nonclient.c b/win32ss/user/ntuser/nonclient.c index 796f5772690..2324cc04afd 100644 --- a/win32ss/user/ntuser/nonclient.c +++ b/win32ss/user/ntuser/nonclient.c @@ -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;