Jump to content

Simple Windows Window Mover / Resetter.


malu05
 Share

Recommended Posts

I often hear about people who accidentally get their windows popped off the screen and then being unable to get them back.

This often happens when people use 2 monitors and one of them burn off or so, so suddenly all windows are binded to a part of the desktop that is no longer visible.

I know this is ultra simple and almost the same as the template but incase you need it.

This script goes through all open windows in windows ^^ and ask if you want to move them, and if you do you can set a position or use "center" to put it on the center of the screen.

$var = WinList()
MsgBox(0,"Mads's Window Reset","Welcome to the Windows Windows Resetter")
For $i = 1 to $var[0][0]
    If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
        $pressed = MsgBox(1, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1] & @LF & "Do you want to reset this?")
        if $pressed =  1 Then
            $input = InputBox("Offset?","Where do you want the window to be placed?(x,x), you can also type 'center' to place in center of screen") 
            if $input = "center" Then
                $x = (@DesktopWidth/2) 
                $y = (@DesktopHeight/2) 
            Else
                $x = $input
                $y = $input
            EndIf
            WinMove($var[$i][0], "", $x, $y, (@DesktopWidth/4), (@DesktopHeight/3))
        Else
        ;nothing
        EndIf
    EndIf
Next
Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc

[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...