Retrieves a handle to the display monitor that has the largest area of intersection with the specified window
#include <WinAPIGdi.au3>
_WinAPI_MonitorFromWindow ( $hWnd [, $iFlag = 1] )
$hWnd | A handle to the window of interest. |
$iFlag | [optional] The flag that specifies the function's return value if the window does not intersect any display monitor. This parameter can be one of the following values. $MONITOR_DEFAULTTONULL $MONITOR_DEFAULTTONEAREST (Default) $MONITOR_DEFAULTTOPRIMARY |
If the window is currently minimized, the function uses the rectangle of the window before it was minimized.
Search MonitorFromWindow in MSDN Library.