mjg Posted December 6, 2007 Posted December 6, 2007 I have two monitors, and I'm trying to figure the most efficient way to move all active programs on monitor A to monitor B (same location as on monitor A, just on monitor and then move any active applications on monitor B to monitor A (basically just swapping monitors). I'm still fairly novice at AutoIT and really don't know where to start for such an application. Any ideas? -mjg
weaponx Posted December 6, 2007 Posted December 6, 2007 (edited) Umm I think you need to be more descriptive. Is your desktop spanning 2 screens? What result do you get from this code? MsgBox(0,"",@DesktopWidth) What is your desktop resolution? Try this: #include <array.au3> $result = WinList ("") _ArrayDisplay($result) $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then ;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1]) $currentPosition = WinGetPos ($var[$i][1]) If $currentPosition[0] < (@DesktopWidth / 2) Then WinMove($var[$i][1], "", $currentPosition[0] + (@DesktopWidth / 2), $currentPosition[1]) EndIf EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Edited December 6, 2007 by weaponx
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now