Jump to content

Windowshake


 Share

Recommended Posts

  • Moderators

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
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...