Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine active monitor of the current cursor location

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.

like image 920
skamradt Avatar asked Dec 05 '22 07:12

skamradt


2 Answers

GetCursorPos and MonitorFromPoint.

like image 83
Roger Lipscombe Avatar answered Dec 28 '22 23:12

Roger Lipscombe


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

like image 22
Barry Kelly Avatar answered Dec 29 '22 01:12

Barry Kelly