win32: remove useless error checking

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-05-18 09:24:25 +08:00
parent e162345c62
commit 8f31e67dae
1 changed files with 0 additions and 8 deletions

View File

@ -558,14 +558,6 @@ void Utils::showSystemMenu(const WId windowId, const QPoint &pos, const bool sel
SetMenuDefaultItem(hMenu, SC_CLOSE, FALSE);
const int result = TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft()
? TPM_RIGHTALIGN : TPM_LEFTALIGN)), pos.x(), pos.y(), 0, hWnd, nullptr);
// TrackPopupMenu returns 0: the user cancelled the menu, or some error occurred.
if (result == 0) {
const DWORD dwError = GetLastError();
if (dwError != ERROR_SUCCESS) {
qWarning() << __getSystemErrorMessage(kTrackPopupMenu, dwError);
}
return;
}
if (PostMessageW(hWnd, WM_SYSCOMMAND, result, 0) == FALSE) {
qWarning() << getSystemErrorMessage(kPostMessageW);
}