Sign in to follow this  
Followers 0
youknowwho4eva

Window Transistions

13 posts in this topic

#1 ·  Posted (edited)

Not as cool as I had hoped but still pretty neat.

It takes a sec to set it's self up. It will minimize all inactive windows off the screen. When it is set, it will transition from one window to the next. The new active window will grow over top the former active window. Then the former active window will shrink away behind it. I made it faster because set slower the window slows as it grows. Change wininactive[$f][2] and wininactive[$f][3] to make the window grow from different areas.

Global $activewins[1000][1000]
Global $winactive[1000][1000]
Global $wininactive[1000][1000]
Global $currentat[1000]
Global $currentactive

While 1
$activewins = WinList()
For $i = 1 to $activewins[0][0]


    If StringLen($activewins[$i][0]) > 0 and isvisible($activewins[$i][1]) Then
;~  MsgBox(0,$activewins[0][0],$i,2)
        $f = $activewins[$i][0]
        $currentat = WinGetPos($f)
        $winactive[$f][0] = $currentat[2]
        $winactive[$f][1] = $currentat[3]
        $winactive[$f][2] = $currentat[0]
        $winactive[$f][3] = $currentat[1]
        $wininactive[$f][0] = 5
        $wininactive[$f][1] = 5
        $wininactive[$f][2] = @DesktopWidth + 50
        $wininactive[$f][3] = @DesktopHeight + 50
        If WinActive($f) Then
            $currentactive = $f
            $currentat = WinGetPos($f)
            If $currentat[0] <> $winactive[$f][2] And $currentat[1] <> $winactive[$f][3] And $currentat[2] <> $winactive[$f][0] And $currentat[3] <> $winactive[$f][1] Then
                WinMove($f,"",$winactive[$f][2],$winactive[$f][3],$winactive[$f][0],$winactive[$f][1],5)
            EndIf
;~          WinWaitNotActive($f)
        Else
            $currentat = WinGetPos($f)
            If $currentat[0] <> $wininactive[$f][2] And $currentat[1] <> $wininactive[$f][3] And $currentat[2] <> $wininactive[$f][0] And $currentat[3] <> $wininactive[$f][1] Then
                WinMove($f,"",$wininactive[$f][2],$wininactive[$f][3],$wininactive[$f][0],$wininactive[$f][1],5)
            EndIf
        EndIf
    EndIf
Next
wait()
Sleep(10)
WEnd
Func wait()
;~  MsgBox(0,"","Here")
    WinWaitNotActive($currentactive)
    WinMove($currentactive,"",$wininactive[$f][2],$wininactive[$f][3],$wininactive[$f][0],$wininactive[$f][1],5)
    work()
EndFunc

Func work()
While 1
$activewins = WinList()
For $i = 1 to $activewins[0][0]


    If StringLen($activewins[$i][0]) > 0 and isvisible($activewins[$i][1]) Then
;~  MsgBox(0,$activewins[0][0],$i,2)
        $f = $activewins[$i][0]
        If WinActive($f) Then
            $currentactive = $f
            $currentat = WinGetPos($f)
            If $currentat[0] <> $winactive[$f][2] And $currentat[1] <> $winactive[$f][3] And $currentat[2] <> $winactive[$f][0] And $currentat[3] <> $winactive[$f][1] Then
                WinMove($f,"",$winactive[$f][2],$winactive[$f][3],$winactive[$f][0],$winactive[$f][1],5)
            EndIf
;~          WinWaitNotActive($f)
        Else
            $currentat = WinGetPos($f)
            If $currentat[0] <> $wininactive[$f][2] And $currentat[1] <> $wininactive[$f][3] And $currentat[2] <> $wininactive[$f][0] And $currentat[3] <> $wininactive[$f][1] Then
                WinMove($f,"",$wininactive[$f][2],$wininactive[$f][3],$wininactive[$f][0],$wininactive[$f][1],5)
            EndIf
        EndIf
    EndIf
Next
wait()
Sleep(10)
WEnd
EndFunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Edit: I change my mind, it is as cool as I thought it would be.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites



Excellent Idea, and Great Program :P


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

Thank you sir, I did notice it needs to check for certain things. Like the volume control. LOL it stretched onto my whole screen. Also the internet radio I listen to didn't like being re sized. The volume would be easy to but an exception in there, the purposely sized windows, I wouldn't know where to start to fix. Also if you exit the program, all your non active windows are minimized off the screen. All but the internet radio were easy to restore.


Giggity

Share this post


Link to post
Share on other sites

Thank you sir, I did notice it needs to check for certain things. Like the volume control. LOL it stretched onto my whole screen. Also the internet radio I listen to didn't like being re sized. The volume would be easy to but an exception in there, the purposely sized windows, I wouldn't know where to start to fix. Also if you exit the program, all your non active windows are minimized off the screen. All but the internet radio were easy to restore.

I must not of done enough testing, I didn't have any of those problems, all of my windows were already maximized when I first tested the script, and all my windows I brought back onto the screen before exiting. So I didn't even notice anything wrong with it.

You could put in there on AutoitExit to have it restore all the windows to their original place. As for the resizing....I'm not sure how to prevent that with your current script.


"The true measure of a man is how he treats someone who can do him absolutely no good."

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I could have it activate all widows, grab their individual positions, and store that as their defaults. I could also use winwaitactive to make it so it's not running when the same window is already up. It was just a quick "I have an idea" script. If anyone else wants to add to it or what ever feel free. I'm not planning on working on it any more unless I get bored later, so expect an update this afternoon :P

Edit: just noticed, I changed it so the height of the non active windows is half of the desktop height, and they still move from the bottom right. I changed it to try and move from the top left, and they just appear, so it would require some tweeking to make it work the way intended.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites

I too am having nasty problems with windows all jacked up.. :P

Share this post


Link to post
Share on other sites

Try the new version (updated first post). I am much more pleased with it. Still needs some work but it's in the right direction now.


Giggity

Share this post


Link to post
Share on other sites

Nice idea but which OS your are using?


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

XP sp3, I'm not to happy with the winmove function, I may make my own function to do the resizing the way I want. If you notice it now, it resizes then moves. I want it to do all simultaneously.


Giggity

Share this post


Link to post
Share on other sites

XP sp3, I'm not to happy with the winmove function, I may make my own function to do the resizing the way I want. If you notice it now, it resizes then moves. I want it to do all simultaneously.

I'm using Vista and Vista has its own windows min. / max. function which will be mixed up with your function!

I will test it soon on non Vista systems :P

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

very very good work

it only puts wondows ontop of my taskbar (xp sp3) so it messes it all up a bit

good work again! :P


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

very very good work

it only puts wondows ontop of my taskbar (xp sp3) so it messes it all up a bit

good work again! :unsure:

The quick fix I have found for this is hitting the windows key. That'll bring up the start menu and bring the task bar back on top

@Vista users: What doesn't Vista mess up :P

Edit: New Version. I have Dual Monitors here so it doesn't quit look right, But I believe it should look better on a single monitor. If someone will try it out for me.

Another Edit: Scratch the above edit. I fixed it for dual monitors as long as the resolution is the same. I'm happy with it. But if you want any changes let me know.

Global $activewins[1000][1000]
Global $winactive[1000][1000]
Global $wininactive[1000][1000]
Global $currentat[1000]
Global $currentactive
HotKeySet("x","exitprog")
While 1
$activewins = WinList()
For $i = 1 to $activewins[0][0]


    If StringLen($activewins[$i][0]) > 0 and isvisible($activewins[$i][1]) Then
;~  MsgBox(0,$activewins[0][0],$i,2)
        $f = $activewins[$i][0]
        $currentat = WinGetPos($f)
        $winactive[$f][0] = $currentat[2]/2
        $winactive[$f][1] = $currentat[3]
        $winactive[$f][2] = $currentat[0]/2
        $winactive[$f][3] = $currentat[1]
        $wininactive[$f][0] = 5
        $wininactive[$f][1] = 5
        $wininactive[$f][2] = @DesktopWidth*2 + 50
        $wininactive[$f][3] = @DesktopHeight + 50
        If WinActive($f) Then
            $currentactive = $f
            $currentat = WinGetPos($f)
            If $currentat[0] <> $winactive[$f][2] And $currentat[1] <> $winactive[$f][3] And $currentat[2] <> $winactive[$f][0] And $currentat[3] <> $winactive[$f][1] Then
                WinMove($f,"",$winactive[$f][2],$winactive[$f][3],$winactive[$f][0],$winactive[$f][1])
            EndIf
;~          WinWaitNotActive($f)
        Else
            $currentat = WinGetPos($f)
            If $currentat[0] <> $wininactive[$f][2] And $currentat[1] <> $wininactive[$f][3] And $currentat[2] <> $wininactive[$f][0] And $currentat[3] <> $wininactive[$f][1] Then
                WinMove($f,"",$wininactive[$f][2],$wininactive[$f][3],$wininactive[$f][0],$wininactive[$f][1])
            EndIf
        EndIf
    EndIf
Next
wait()
Sleep(10)
WEnd
Func wait()
;~  MsgBox(0,"","Here")
    WinWaitNotActive($currentactive)
    WinMovesize($currentactive,"",$winactive[$f][2],$wininactive[$f][2],$winactive[$f][3],$wininactive[$f][3],$winactive[$f][0],$wininactive[$f][0],$winactive[$f][1],$wininactive[$f][1])
;~  MsgBox(0,"","Here?")
    work()
EndFunc

Func work()
While 1
$activewins = WinList()
For $i = 1 to $activewins[0][0]


    If StringLen($activewins[$i][0]) > 0 and isvisible($activewins[$i][1]) Then
;~  MsgBox(0,$activewins[0][0],$i,2)
        $f = $activewins[$i][0]
        If WinActive($f) Then
            $currentactive = $f
;~          MsgBox(0,"",$currentactive)
            $currentat = WinGetPos($f)
            If $currentat[0] <> $winactive[$f][2] And $currentat[1] <> $winactive[$f][3] And $currentat[2] <> $winactive[$f][0] And $currentat[3] <> $winactive[$f][1] Then
                WinMovesize($f,"",$wininactive[$f][2],$winactive[$f][2],$wininactive[$f][3],$winactive[$f][3],$wininactive[$f][0],$winactive[$f][0],$wininactive[$f][1],$winactive[$f][1])
            EndIf
;~          WinWaitNotActive($f)
        Else
            $currentat = WinGetPos($f)
            If $currentat[0] <> $wininactive[$f][2] And $currentat[1] <> $wininactive[$f][3] And $currentat[2] <> $wininactive[$f][0] And $currentat[3] <> $wininactive[$f][1] Then
                WinMovesize($f,"",$winactive[$f][2],$wininactive[$f][2],$winactive[$f][3],$wininactive[$f][3],$winactive[$f][0],$wininactive[$f][0],$winactive[$f][1],$wininactive[$f][1])
            EndIf
        EndIf
    EndIf
Next
wait()
Sleep(10)
WEnd
EndFunc

Func exitprog()
$activewins = WinList()
For $i = 1 to $activewins[0][0]


    If StringLen($activewins[$i][0]) > 0 and isvisible($activewins[$i][1]) Then
;~  MsgBox(0,$activewins[0][0],$i,2)
        $f = $activewins[$i][0]
        
                WinMove($f,"",$winactive[$f][2],$winactive[$f][3],$winactive[$f][0],$winactive[$f][1])
    EndIf
Next
MsgBox(0,"","Restored")
Exit
EndFunc



Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Func winmovesize($title,$text,$oldx,$newx,$oldy,$newy,$oldw,$neww,$oldh,$newh)
    $speed = 65
    If $oldx > $newx Then
        $differencex = $oldx - $newx
        $xmove = -$differencex/$speed
        
    Else
        $differencex = $newx - $oldx
        $xmove = $differencex/$speed
    EndIf
    If $oldy > $newy Then
        $differencey = $oldy - $newy
        $ymove = -$differencey/$speed
    Else
        $differencey = $newy - $oldy
        $ymove = $differencey/$speed
    EndIf
    If $oldw > $neww Then
        $differencew = $oldw - $neww
    $wmove = -$differencew/$speed
    Else
        $differencew = $neww - $oldw
    $wmove = $differencew/$speed
    EndIf
    If $oldh > $newh Then
        $differenceh = $oldh - $newh
    $hmove = -$differenceh/$speed
    Else
        $differenceh = $newh - $oldh
    $hmove = $differenceh/$speed
    EndIf
    
    
    For $i = 1 To $speed
        $oldx += $xmove
        $oldy += $ymove
        $oldw += $wmove
        $oldh += $hmove
        WinMove($title,$text,Default,Default,$oldw,$oldh,.75)
        WinMove($title,$text,$oldx,$oldy,Default,Default,1.75)
;~      Sleep(10)
;~      MsgBox(0,$title,$oldx + $xmove & @LF & $oldy + $ymove & @LF & $oldw + $wmove & @LF & $oldh + $hmove)
    Next
EndFunc

Another Edit: Oh Yea, forgot I added x to exit and restore.

Edited by youknowwho4eva

Giggity

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  
Followers 0