[SHELL32] Fix Deselect highlighted item in shell menus on close (#7904)

CORE-18855

Add a call to _ChangeHotItem(NULL, -1, 0) in CMenuBand::OnSelect(MPOS_CANCELLEVEL) which causes to deselect currently selected item the moment the menu bands (including start menu) are closing.
Start Menu is not destroyed when it's closed so its allocated resources can be re-used next time user wants to open it, so to keep this behavior and still not having an item selected every time you open the start menu, you have to deselect the currently selected item.
This commit is contained in:
Mohammad Amin Mollazadeh 2025-04-24 00:40:08 +03:30 committed by GitHub
parent fcc2247774
commit 860262952d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -588,6 +588,8 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnSelect(DWORD dwSelectType)
case MPOS_CANCELLEVEL:
if (m_subMenuChild)
m_subMenuChild->OnSelect(dwSelectType);
// Deselect the currently selected item
_ChangeHotItem(NULL, -1, 0);
break;
}
return S_FALSE;