mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 11:16:11 +00:00
[WIN32K:NTUSER] Handle IntGetSystemMenu failure cases. CORE-12180
This commit is contained in:
parent
b7aa1e3122
commit
56fdb7adde
1 changed files with 3 additions and 3 deletions
|
@ -737,7 +737,7 @@ UserDrawCaptionButton(PWND pWnd, LPRECT Rect, DWORD Style, DWORD ExStyle, HDC hD
|
||||||
case DFCS_CAPTIONCLOSE:
|
case DFCS_CAPTIONCLOSE:
|
||||||
{
|
{
|
||||||
PMENU pSysMenu = IntGetSystemMenu(pWnd, FALSE);
|
PMENU pSysMenu = IntGetSystemMenu(pWnd, FALSE);
|
||||||
UINT MenuState = IntGetMenuState(UserHMGetHandle(pSysMenu), SC_CLOSE, MF_BYCOMMAND); /* in case of error MenuState==0xFFFFFFFF */
|
UINT MenuState = IntGetMenuState(pSysMenu ? UserHMGetHandle(pSysMenu) : NULL, SC_CLOSE, MF_BYCOMMAND); /* in case of error MenuState==0xFFFFFFFF */
|
||||||
|
|
||||||
/* A tool window has a smaller Close button */
|
/* A tool window has a smaller Close button */
|
||||||
if (ExStyle & WS_EX_TOOLWINDOW)
|
if (ExStyle & WS_EX_TOOLWINDOW)
|
||||||
|
@ -1380,7 +1380,7 @@ NC_DoButton(PWND pWnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
case HTCLOSE:
|
case HTCLOSE:
|
||||||
SysMenu = IntGetSystemMenu(pWnd, FALSE);
|
SysMenu = IntGetSystemMenu(pWnd, FALSE);
|
||||||
MenuState = IntGetMenuState(UserHMGetHandle(SysMenu), SC_CLOSE, MF_BYCOMMAND); /* in case of error MenuState==0xFFFFFFFF */
|
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->style & CS_NOCLOSE))
|
||||||
return;
|
return;
|
||||||
ButtonType = DFCS_CAPTIONCLOSE;
|
ButtonType = DFCS_CAPTIONCLOSE;
|
||||||
|
@ -1554,7 +1554,7 @@ NC_HandleNCLButtonDblClk(PWND pWnd, WPARAM wParam, LPARAM lParam)
|
||||||
case HTSYSMENU:
|
case HTSYSMENU:
|
||||||
{
|
{
|
||||||
PMENU SysMenu = IntGetSystemMenu(pWnd, FALSE);
|
PMENU SysMenu = IntGetSystemMenu(pWnd, FALSE);
|
||||||
UINT state = IntGetMenuState(UserHMGetHandle(SysMenu), SC_CLOSE, MF_BYCOMMAND);
|
UINT state = IntGetMenuState(SysMenu ? UserHMGetHandle(SysMenu) : NULL, SC_CLOSE, MF_BYCOMMAND);
|
||||||
|
|
||||||
/* If the close item of the sysmenu is disabled or not present do nothing */
|
/* If the close item of the sysmenu is disabled or not present do nothing */
|
||||||
if ((state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF))
|
if ((state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue