How to determine active monitor of the current cursor location
Asked Answered
F

2

5

I currently have an application which needs to have an awareness of which monitor the cursor is located when running in a multi-monitor configuration.

Fellows answered 23/10, 2008 at 12:23 Comment(0)
B
12

GetCursorPos and MonitorFromPoint.

Benignity answered 23/10, 2008 at 12:25 Comment(0)
T
6

Don't forget Screen.MonitorFromPoint and Mouse.CursorPos - these WinAPI functions are encapsulated in the VCL.

Tamas answered 23/10, 2008 at 13:10 Comment(1)
Als remember that Mouse.CursorPos throws exceptions if there is no mouse pos. For example when the user session is disconnected (XP fast user switching or terminal server).Torrential

© 2022 - 2024 — McMap. All rights reserved.