Const POS_ALL = &H7
Set sys = CreateObject("UltraMon.System")
If sys.NumActiveMonitors > 1 Then
	'disable secondary monitors
	sys.SavePositions POS_ALL
	For Each mon In sys.Monitors
		If mon.Primary = False And mon.Enabled = True Then
			mon.Enabled = False
			sys.ApplyMonitorChanges
		End If
	Next
Else
	'enable secondary monitors
	For Each mon In sys.Monitors
		If mon.Enabled = False Then
			mon.Enabled = True
			sys.ApplyMonitorChanges
		End If
	Next
	sys.RestorePositions POS_ALL
End If