_WindowForceToPrimaryMonitor

Forces window to primary monitor if window isn't on target monitor any more due to monitor deactivation, desktop setting changed to 'Duplicate', etc.

#include "Window, Screen, Mouse and Control.au3"
_WindowForceToPrimaryMonitor( $hGUI )

parameters

$hGUI Window GUI handle

return value

Boolean True if forced to primary monitor

example

; restore GUI to former position as stored in $SavedPos[]
$hMyGUI = GUICreate("My amazing app", 500, 300, $SavedPos[0], $SavedPos[2])
_WindowForceToPrimaryMonitor($hMyGUI)   ; if needed force GUI to primary monitor when $SavedPos[] is outside desktop area