Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
win32: remove useless error checking
Browse files Browse the repository at this point in the history
Signed-off-by: Yuhang Zhao <[email protected]>
  • Loading branch information
wangwenx190 committed May 18, 2022
1 parent e162345 commit 8f31e67
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/core/utils_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8f31e67

Please sign in to comment.