Jump to content

Recommended Posts

Posted

Hello all. 

Dear community, I'm making a script to monitor some windows. 

I would like to know if some of you can advise me or point me in the correct direction to shake a window when some statements are verified. 

 

Thanks in advance for your advises. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted

I really liked Seminko's find, and thought "ShakeWindow" function should work on any window.
 

; Modified version of "Shake Window" by Death Pax <death_pax@msn.com> from
; https://www.autoitscript.com/forum/topic/22277-new-scrap-shake-window/
; Press Shift-Alt-s keys together and current window with focus will shake.

HotKeySet("{ESC}", "Terminate")
HotKeySet("+!s", "_ShakeWindow") ; Shift-Alt-s

While Sleep(100)
WEnd


Func _ShakeWindow()
    Local $Window = WinGetTitle("", ""), $ShakeAmount = 5, $Win_pos = WinGetPos($Window)
    For $i = 0 To 100
        WinMove($Window, "", $Win_pos[0], $Win_pos[1] + $ShakeAmount * Mod($i, 2))
        Sleep(40)
    Next
EndFunc   ;==>_ShakeWindow

Func Terminate()
    Exit
EndFunc   ;==>Terminate

 

Posted
  On 7/30/2019 at 4:06 AM, badcoder123 said:

Modify this so it's a quick circle

Expand  

Yes Sir.

Use Shift-Alt-s on this example.

; Modified version of "Shake Window" by Death Pax <death_pax@msn.com> from
; https://www.autoitscript.com/forum/topic/22277-new-scrap-shake-window/
; Press Shift-Alt-a keys together and current window with focus will shake up and down.
; Press Shift-Alt-s keys together and current window with focus will shake circular.

HotKeySet("{ESC}", "Terminate")
HotKeySet("+!a", "_ShakeWindow") ; Shift-Alt-a
HotKeySet("+!s", "_ShakeWindow2") ; Shift-Alt-s

While Sleep(100)
WEnd


Func _ShakeWindow()
    Local $Window = WinGetTitle("", ""), $ShakeAmount = 5, $Win_pos = WinGetPos($Window)
    For $i = 0 To 100
        WinMove($Window, "", $Win_pos[0], $Win_pos[1] + $ShakeAmount * Mod($i, 2))
        Sleep(40)
    Next
EndFunc   ;==>_ShakeWindow

Func _ShakeWindow2()
    Local $Window = WinGetTitle("", ""), $R = 50, $Win_pos = WinGetPos($Window), $pi = 4 * ATan(1)
    Local $Win_pos = WinGetPos($Window), $centerX = $Win_pos[0], $centerY = $Win_pos[1]
    For $i = 0 To 20 * $pi Step $pi / 8
        WinMove($Window, "", $centerX + ($R * Cos($i)), $centerY + ($R * Sin($i)))
        Sleep(10)
    Next
    WinMove($Window, "", $centerX, $centerY)
EndFunc   ;==>_ShakeWindow2

Func Terminate()
    Exit
EndFunc   ;==>Terminate

 

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
  • Recently Browsing   0 members

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