Jump to content

help with shaking a child window


 Share

Recommended Posts

okay i want to shake a chat window kind of like a nudge effect on msn

here is my code

$sText = '<font face="Verdana" size=-1>' & StringReplace($sText, "::ScriptDir::", @ScriptDir)
                        For $r = 0 To $MaxChildWindow - 1
                            If $ChildConversation[$r] = $sUsername Then
                                $Read = _IEBodyReadHTML($ChildShowText[$r])
                                If $Read == 0 Then
                                    $Read = ""
                                EndIf
                                _IEBodyWriteHTML($ChildShowText[$r], $Read & $sText)
                                $iDocHeight = $ChildShowText[$r].document.body.scrollHeight
                                $ChildShowText[$r].document.parentwindow.scrollTo (0, $iDocHeight)
                                If Not WinActive($ChildWindow[$r]) Then
                                    WinFlash($ChildWindow[$r], "", 2, 250)
                                    soundplay ("type.wma")
                                    Switch $sText
    Case '/Nudge'
        soundplay ("nudge.wma")
        winactivate($ChildWindow[$r])
        $hwnd =  wingethandle($ChildWindow[$r])
GUISetStyle ($DS_SETFOREGROUND, -1, $hwnd)
$title = $ChildWindow[$r]
$x=0
do
    $x = 1 + $X
WinMove ( $title, "", 0, 1 )
WinMove ( $title, "", 3, 5 )
WinMove ( $title, "", 1, 1 )
WinMove ( $title, "", 10, 20 )
WinMove ( $title, "", 5, 1 )
WinMove ( $title, "", 0, 2 )
WinMove ( $title, "", 60, 5 )
WinMove ( $title, "", 0, 0 )
until $X = 10 
EndSwitch
                                EndIf
                                ExitLoop
                            ElseIf $r = $MaxChildWindow - 1 Then
                                StartConversation($sUsername)
                                $q = @extended
                                _IEBodyWriteHTML($ChildShowText[$q], $sText & "<br>")
                                If Not WinActive($ChildWindow[$q]) Then
                                    WinFlash($ChildWindow[$q], "", 2, 250)
                                    soundplay ("type.wma")
                                    Switch $sText
Case '/Nudge'
        soundplay ("nudge.wma")
        winactivate($ChildWindow[$q])
        $hwnd =  wingethandle($ChildWindow[$q])
GUISetStyle ($DS_SETFOREGROUND, -1, $hwnd)
$title = $ChildWindow[$q]
$x=0
do
    $x = 1 + $X
WinMove ( $title, "", 0, 1 )
WinMove ( $title, "", 3, 5 )
WinMove ( $title, "", 1, 1 )
WinMove ( $title, "", 10, 20 )
WinMove ( $title, "", 5, 1 )
WinMove ( $title, "", 0, 2 )
WinMove ( $title, "", 60, 5 )
WinMove ( $title, "", 0, 0 )
until $X = 10 
EndSwitch

it wont work the window dosent move... so what do i do?

Edited by emoyasha
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

$GUI = GUICreate ("", 200, 200)
GUISetState (@SW_SHOW)

$Win = WinGetPos ($GUI)
For $i = 1 to 10
    WinMove ($GUI, "", $Win[0] + 10, $win[1])
    Sleep (10)
    WinMove ($GUI, "", $Win[0], $win[1] + 10)
    Sleep (10)
    WinMove ($GUI, "", $Win[0] - 10, $win[1])
    Sleep (10)
    WinMove ($GUI, "", $Win[0], $win[1] - 10)
    Sleep (10)
    WinMove ($GUI, "", $Win[0], $win[1])
Next

Link to comment
Share on other sites

Aye. You should. And talking of shaking, aparently the shaky camera work in Cloverfield was causing people to get motion sickness...

Edited by Bert
Link to comment
Share on other sites

will try soon

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

it dosent seem to work, is there a way to do it using the title like this $sUsername & " - Conversation"

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

h-e-l-l-o?

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

h-e-l-l-o?

Yes? I was out. Funnily enough its Australia Day here... And i was out having a good time. >_>. Aussie Aussie Aussie! *falls over from being drunk*

What doesnt work? Look at opt in the help file or Window Titles and Text (Advanced) under Usage. An example for _WinAPI_FlashWindow and _WinAPI_FlashWindowEx:

_WinAPI_FlashWindow:

#AutoIt3Wrapper_au3check_parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
; _Win_API Examples
; Function:  _WinApi_FlashWindow

#include <WinAPI.au3>
#include <GUIConstants.au3>

Opt('MustDeclareVars', 1)

Example_Internal()

Func Example_Internal()
    Local $hwnd, $msg, $btnFlash
    $hwnd = GUICreate("__WinAPI_FlashWindow Example", 200, 200)
    $btnFlash = GUICtrlCreateButton("Flash Window", 50, 85, 100, 30)
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $btnFlash
                GUISetState(@SW_MINIMIZE)
                Sleep(1000)
                _WinAPI_FlashWindow($hwnd)
                Sleep(6000)
        EndSelect
    WEnd
EndFunc  ;==>Example_Internal

_WinAPI_FlashWindowEx:

#AutoIt3Wrapper_au3check_parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
; _Win_API Examples
; Function:  _WinApi_FlashWindowEx

#include <WinAPI.au3>
#include <GUIConstants.au3>

Opt('MustDeclareVars', 1)

Example_Internal()

Func Example_Internal()
    Local $hwnd, $Flash, $Timeout, $btnFlash, $msg, $flashrate, $timeoutrate, $flashing = False
    $hwnd = GUICreate("Form1", 229, 170, 193, 125)
    $Flash = GUICtrlCreateInput("20", 80, 72, 121, 21)
    $Timeout = GUICtrlCreateInput("500", 80, 103, 121, 21)
    GUICtrlCreateLabel("Please input the flash rate, and the time between flashes", 8, 24, 214, 41)
    GUICtrlCreateLabel("Flash Rate:", 16, 72, 58, 17)
    GUICtrlCreateLabel("Timeout (ms)", 16, 104, 64, 17)
    $btnFlash = GUICtrlCreateButton("Flash Window", 80, 136, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #endregion

    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $btnFlash
                If $flashing Then
                    _WinAPI_FlashWindowEx($hwnd, 0)
                    $flashing = False
                Else
                    $flashrate = GUICtrlRead($Flash)
                    $timeoutrate = GUICtrlRead($Timeout)
                    _WinAPI_FlashWindowEx($hwnd, 2, $flashrate, $timeoutrate)
                    GUICtrlSetData($btnFlash, "Stop Flashing")
                    $flashing = True
                EndIf
        EndSwitch
    WEnd
EndFunc  ;==>Example_Internal
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...