Sign in to follow this  
Followers 0
Faustvii

Windowshake

6 posts in this topic

#1 ·  Posted (edited)

///

Edited by Liope

Share this post


Link to post
Share on other sites



what is "isVisible" ? is that a beta function ?

phil

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i dont get error if i remove isVisible but i know it works cause i have it working in another file and i just copy pasted it from that file but i doesnt shake too...

Edited by Liope

Share this post


Link to post
Share on other sites

never mind i was stupid and forgot something

Share this post


Link to post
Share on other sites

It helps if you tell the function to run.

windowShake()
Func windowShake()
    
    $windowArray = WinList()
    
    
    $numShakes = 100
    $shakeIntensity = 100
    $shakeDelay = 5
    
    For $i = 1 To $windowArray[0][0]
        If @error <> 0 Then Exit
         If $windowArray[$i][0] <> "" And IsVisible($windowArray[$i][1]) Then; And WinActive($windowArray[$i][0]) Then
             $posArray = WinGetPos($windowArray[$i][0])
             
             For $x = 1 To $numShakes
                 If Random(0, 1) = 1 Then $shakeIntensity = $shakeIntensity * - 1
                 WinMove($windowArray[$i][0], "", $posArray[0] + $shakeIntensity, $posArray[1] + $shakeIntensity)
                 Sleep(10)
                 WinMove($windowArray[$i][0], "", $posArray[0], $posArray[1])
             Next
         EndIf
    Next
EndFunc;==>windowShake

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

EndFunc

Share this post


Link to post
Share on other sites

no it helps to add the func isvisible..

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