Const RESTORE_IF_MAXIMIZED = False 'set this to True to restore maximized windows to normal size, False otherwise

Const MOVEMONITOR_NEXT = -1
Const SHOWSTATE_NORMAL = 2 
Const SHOWSTATE_MAXIMIZED = 3
Const WNDCHANGE_CLIP_TO_WORKSPACE = 2

Set wnd = CreateObject("UltraMon.Window")
If wnd.GetForegroundWindow() = True Then
	wnd.Monitor = MOVEMONITOR_NEXT
	If RESTORE_IF_MAXIMIZED = True And wnd.ShowState = SHOWSTATE_MAXIMIZED Then
		wnd.ShowState = SHOWSTATE_NORMAL
	Else
		wnd.ShowState = SHOWSTATE_MAXIMIZED
	End If
	wnd.ApplyChanges WNDCHANGE_CLIP_TO_WORKSPACE
End If
