diff options
Diffstat (limited to 'c/drag.cpp')
-rw-r--r-- | c/drag.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -24,7 +24,8 @@ bool Dragger::IsDown() const bool Dragger::HandleLButtonDown() { POINT pt; - Require(GetRelativeCursorPos(parent.hWnd, &pt)); + if (!GetRelativeCursorPos(parent.hWnd, &pt)) + throw Err(WINDOWS, L"Mouse cursor position could not be retrieved: %s"); if (!InDragArea(pt.x, pt.y)) return false; if (IsDouble(GetMessageTime(), pt)) { @@ -39,7 +40,8 @@ bool Dragger::HandleLButtonDown() bool Dragger::HandleSetCursor() { POINT pt; - Require(GetRelativeCursorPos(parent.hWnd, &pt)); + if (!GetRelativeCursorPos(parent.hWnd, &pt)) + throw Err(WINDOWS, L"Mouse cursor position could not be retrieved: %s"); extern HCURSOR g_hcSizeNs; bool r = true; @@ -60,7 +62,8 @@ bool Dragger::HandleSetCursor() bool DlvDragger::InDragArea(const int x, const int y) const { RECT rrDlv; - Require(GetRelativeRect(parent.dlv.hWnd, &rrDlv)); + if (!GetRelativeRect(parent.dlv.hWnd, &rrDlv)) + throw Err(WINDOWS, L"Data list view rectangle could not be retrieved: %s"); const int pad = EBIsThemeActive()? Dpi(6): 0; const int extra = EBIsThemeActive()? 0: Dpi(2); @@ -72,7 +75,8 @@ bool DlvDragger::InDragArea(const int x, const int y) const void DlvDragger::Drag(const int, const int y) const { RECT rrDlv; - Require(GetRelativeRect(parent.dlv.hWnd, &rrDlv)); + if (!GetRelativeRect(parent.dlv.hWnd, &rrDlv)) + throw Err(WINDOWS, L"Data list view rectangle could not be retrieved: %s"); if (y < Dpi(50) || y > rrDlv.bottom-Dpi(20)) return; |