Jump to content
Sign in to follow this  

Is this possible? (Program/Monitor Switch)

Recommended Posts

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?


Share this post

Link to post
Share on other sites

Umm I think you need to be more descriptive.

Is your desktop spanning 2 screens?

What result do you get from this code?


What is your desktop resolution?

Try this:

#include <array.au3>
$result = WinList ("")

$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])

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
    Return 0
Edited by weaponx

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...