diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-18 18:55:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-18 18:55:17 +0300 |
commit | c62b3ef92f0499f00bd72581f2acc8f128e82ebb (patch) | |
tree | 1fb2e376aa74c817ae0e62512473b72652abed32 /src/core/stdmsg | |
parent | 3c5a1a6af8e6cfbd53d0dacffc74819cb1eba2c9 (diff) |
code cleaning
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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;
|