https://git.reactos.org/?p=reactos.git;a=commitdiff;h=685084b63c74f7113883d…
commit 685084b63c74f7113883d748bdbbba0c26fe06b2
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Aug 16 17:34:38 2020 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Aug 16 17:34:38 2020 +0300
[UXTHEME] Properly show disabled close button
CORE-17203
---
dll/win32/uxtheme/nonclient.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c
index 1ff26a32184..e48b5ac693a 100644
--- a/dll/win32/uxtheme/nonclient.c
+++ b/dll/win32/uxtheme/nonclient.c
@@ -277,6 +277,8 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
INT iStateId)
{
INT iPartId;
+ HMENU SysMenu;
+ UINT MenuState;
PWND_DATA pwndData = ThemeGetWndData(pcontext->hWnd);
if (!pwndData)
return;
@@ -284,6 +286,13 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
switch(buttonId)
{
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)
+ {
+ iStateId = (pcontext->Active ? BUTTON_DISABLED :
BUTTON_INACTIVE_DISABLED);
+ }
+
iPartId = pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? WP_SMALLCLOSEBUTTON
: WP_CLOSEBUTTON;
break;