win: system menu: fix separator can't be removed

This commit is contained in:
Yuhang Zhao 2023-10-20 10:59:41 +08:00
parent 4821e8982f
commit c7f48684ec
1 changed files with 2 additions and 1 deletions

View File

@ -1341,7 +1341,8 @@ bool Utils::showSystemMenu(const WId windowId, const QPoint &pos, const bool sel
::EnableMenuItem(hMenu, SC_CLOSE, (MF_BYCOMMAND | (disableClose ? MFS_DISABLED : MFS_ENABLED)));
}
if (removeSeparator) {
if (::DeleteMenu(hMenu, SC_SEPARATOR, MF_BYCOMMAND) == FALSE) {
// Looks like we must use 0 for the second parameter here, otherwise we can't remove the separator.
if (::DeleteMenu(hMenu, 0, MFT_SEPARATOR) == FALSE) {
//WARNING << getSystemErrorMessage(kDeleteMenu);
}
}