Given a specific XY coordinate, this snippet returns the handle to the monitor the coordinate appears on... or 0 if it is off all screens. Particularly useful in multiple monitor setups where monitors have different resolutions or are offset vertically or horizontally (in which case, there are areas of the virtual desktop that are off all screens).
You could also use it to return the handle of the monitor where a window is placed, or where the mouse was clicked, or other similar applications.
#include <WinAPIGdi.au3> ;for _WinOnMonitor()
Func _WinOnMonitor($iXPos, $iYPos)