From c62b3ef92f0499f00bd72581f2acc8f128e82ebb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Apr 2023 18:55:17 +0300 Subject: code cleaning --- src/core/stdmsg/src/msgdialog.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index d552a0ae64..7c87170fcc 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -734,8 +734,6 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) HRGN region = NULL; if (wParam == NULLREGION) { region = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom); - HRGN region2 = CreateRectRgn(rect.left + 1, rect.top + 1, rect.right - 1, rect.bottom - 1); - CombineRgn(region, region, (HRGN)region2, RGN_DIFF); } else { HRGN copy = CreateRectRgn(0, 0, 0, 0); @@ -744,6 +742,12 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) else DeleteObject(copy); } + + if (region) { + HRGN region2 = CreateRectRgn(rect.left + 1, rect.top + 1, rect.right - 1, rect.bottom - 1); + CombineRgn(region, region, region2, RGN_DIFF); + DeleteObject(region2); + } if (HDC hdc = GetDCEx(m_message.GetHwnd(), region, DCX_WINDOW | DCX_CACHE | DCX_INTERSECTRGN | DCX_LOCKWINDOWUPDATE)) { HPEN pen = CreatePen(PS_INSIDEFRAME, 1, RGB(0, 220, 0)); @@ -755,9 +759,9 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) ReleaseDC(m_message.GetHwnd(), hdc); DeleteObject(pen); } - - if (region) + else if (region) DeleteObject(region); + return 0; } break; -- cgit v1.2.3