Jump to content
Sign in to follow this  
death pax

New Scrap: Shake Window

Recommended Posts

death pax

Well, lately Ive been working on a chat client and I decided i should create the functionality of the "Nudge" on msn or "BUZZ!" on yahoo, so i made this simple function for all to enjoy!

; ----------------------------------------------------------------------------
; Shake Window
; Author:        Death Pax <death_pax@msn.com>
;
; Script Function:
;   Shake Window
;
; ----------------------------------------------------------------------------

#include <GUIConstants.au3>
$Gui_Main = GUICreate("Shake Window", 400, 400)
$Button_Shake = GUICtrlCreateButton("Shake Window", 24, 352, 121, 33, 0)
$Button_Close = GUICtrlCreateButton("Close Window", 256, 352, 121, 33, 0)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_Close
        ExitLoop
    Case $msg = $Button_Shake
        _ShakeWindow($Gui_Main, 5)
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

Func _ShakeWindow($Window,$ShakeAmount)
    $Win_pos=WinGetPos($Window)
    For $i=0 to 20 step 1
    WinMove($Window,"", $Win_pos[0],$Win_pos[1]+$ShakeAmount)
    Sleep(10)
    WinMove($Window,"", $Win_pos[0]+$ShakeAmount,$Win_pos[1])
    Sleep(10)
    WinMove($Window,"", $Win_pos[0],$Win_pos[1]-$ShakeAmount)
    Sleep(10)
    WinMove($Window,"", $Win_pos[0]-$ShakeAmount,$Win_pos[1])
    Sleep(10)
    WinMove($Window,"", $Win_pos[0],$Win_pos[1])
    Sleep(10)
    next
EndFunc

let me know what you think of it ^.^

Edited by death pax

Share this post


Link to post
Share on other sites
greenmachine

Just think how hard it would be to read something on the window as it's shaking like that.

That's a lot of fun.

Share this post


Link to post
Share on other sites
death pax

try messing with Shake Amount ^.^ its amusing to say the least :o

Share this post


Link to post
Share on other sites
greenmachine

try messing with Shake Amount ^.^ its amusing to say the least :o

I did, and it went flying all over the screen.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.