summaryrefslogtreecommitdiff
path: root/tipper/popwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r--tipper/popwin.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp
index 6e8ac5c..d0cbf4f 100644
--- a/tipper/popwin.cpp
+++ b/tipper/popwin.cpp
@@ -877,25 +877,25 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowRgn(hwnd,hRgn1,FALSE);
}
return TRUE;
+
case PUM_CALCPOS:
{
RECT wa_rect, r;
- HMONITOR hMonitor;
- hMonitor = MonitorFromPoint(pwd->clcit.ptCursor, MONITOR_DEFAULTTONEAREST);
-
- MONITORINFO mi;
- mi.cbSize = sizeof(mi);
- GetMonitorInfo(hMonitor, &mi);
-
- wa_rect = mi.rcWork;
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &wa_rect, FALSE);
+ if (MyMonitorFromPoint)
+ {
+ HMONITOR hMon = MyMonitorFromPoint(pwd->clcit.ptCursor, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (MyGetMonitorInfo(hMon, &mi))
+ wa_rect = mi.rcWork;
+ }
GetWindowRect(hwnd, &r);
CURSORINFO ci = {sizeof(CURSORINFO)};
GetCursorInfo(&ci);
-
-
int x = 0, y = 0, width = (r.right - r.left), height = (r.bottom - r.top);