Sign in to follow this  
Followers 0
BinaryBrother

GIF stops animating IE UDF after click

14 posts in this topic

#1 ·  Posted (edited)

http://www.isplus.net/~binary/AutoIt/Video5/IECreateEmbed.html

The above video and Title should explain... "GIF Stops animating when clicked. Not just one, all..."

Here is the bit of Javascript being sent when the GIF is clicked.

javascript:ajaxChat.insertText('Posted Image');

Exact Code:

<a href=""javascript:ajaxChat.insertText('<img src="http://win7vista.com/Smileys/custom/icon_axe.gif" />');""><img src=""http://win7vista.com/Smileys/custom/icon_axe.gif""></a>

Double quoted because it is inserted into the Page via This line...

_IEDocInsertHTML($oBody, "<a href=""javascript:ajaxChat.insertText('[img]http://win7vista.com/Smileys/custom/icon_axe.gif[/img]');""><img src=""http://win7vista.com/Smileys/custom/icon_axe.gif""></a>", "beforeend")

Full code and reproducer...

I know there are a lot of unnecessary includes... but that should not matter for a test...

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Inet.au3>
#include <FTP.au3>
#include <ScreenCapture.au3>
#include <Misc.au3>
#include <WinAPI.au3>
Global $Before_Minimize, $During_Minimize, $Blinker    ; <--- For Taskbar Blinker
Global $NotifyMode = 0, $INIDir = @TempDir & "\W7VLogin.ini", $oIE, $Username, $Password, $ChatForm ; <--- Beginning Globals
Chat()
Func Chat()
    Opt("GUIOnEventMode",1)
    Opt("GUIResizeMode", 1)
    $oIE = _IECreateEmbedded()
    $ChatForm = GUICreate("Win7Vista Chat", 800, 650, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
    $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 800, 600)
    ;GUISetOnEvent($GUI_EVENT_MINIMIZE,"BlinkerOn",$ChatForm)
    ;GUISetOnEvent($GUI_EVENT_RESTORE,"BlinkerOff",$ChatForm)
    ;AdlibEnable("CheckBlinker",1000)

    $PCInfo = GUICtrlCreateButton("Send PC Info", 5, 603, 105, 41, $WS_GROUP) ; +115 to the left for new buttons
    GUICtrlSetResizing($PCInfo, 768 + 8 + 2)
    ;GUICtrlSetOnEvent($PCInfo, "SendInfo")

    $SendShotFS = GUICtrlCreateButton("Send Screenshot", 120, 603, 105, 41, $WS_GROUP)
    GUICtrlSetResizing($SendShotFS, 768 + 8 + 2)
    ;GUICtrlSetOnEvent($SendShotFS, "DoScreenshotFS")

    $Options = GUICtrlCreateButton("Options", 235, 603, 105, 41, $WS_GROUP)
    GUICtrlSetResizing($Options, 768 + 8 + 2)
    ;GUICtrlSetOnEvent($Options, "ChatOptions")

    ;$Emoticons = GUICtrlCreateButton("Emoticons", 235 + 115, 603, 105, 41, $WS_GROUP)
    ;GUICtrlSetResizing($Emoticons, 768 + 8 + 2)
    ;GUICtrlSetOnEvent($Emoticons, "Emoticons")

    ;$SendShotRG = GUICtrlCreateButton("Send Screenshot" & @CRLF & "(Region)", 235, 603, 105, 41, $WS_GROUP)

    ;GUICtrlSetOnEvent($SendShotRG, "DoScreenshotRG")
    _IENavigate($oIE, "http://chat.ecobytes.net/", 1)
    GUISetState(@SW_SHOW, $ChatForm)
    GUISetOnEvent($GUI_EVENT_CLOSE, "ChatClose")
    GUICtrlSetResizing($GUIActiveX, $GUI_DOCKBORDERS)
    $oBody = _IEGetObjByName($oIE, "emoticonsContainer", 0)

    ;'<a href="javascript:ajaxChat.insertText(' & "'[img]http://win7vista.com/Smileys/custom/icon_axe.gif[/img]');" & '><img src="http://win7vista.com/Smileys/custom/icon_axe.gif"></a>';"' alt="'
    ;                    + this.emoticonCodes[i]
    ;                    + '" title="'
    ;                    + this.emoticonCodes[i]
    ;                    + '"/></a>'

    sleep(20000)
    $oBody = _IEGetObjByName($oIE, "emoticonsContainer", 0)
    _IEDocInsertHTML($oBody, "<a href=""javascript:ajaxChat.insertText('[img]http://win7vista.com/Smileys/custom/icon_axe.gif[/img]');""><img src=""http://win7vista.com/Smileys/custom/icon_axe.gif""></a>", "beforeend")
    ;_Vista_EnableBlurBehind($ChatForm)
EndFunc   ;==>Chat
While 1
    Sleep(250)
WEnd

;Func Emoticons()
;    MsgBox(0, "Sorry", "Not done yet... :)")
;EndFunc   ;==>Emoticons

Func BlinkerOn()
    $Blinker = True
    $Before_Minimize = _INetGetSource("http://win7vista.com/chat/?ajax=true")
EndFunc   ;==>BlinkerOn

Func BlinkerOff()
    $Blinker = False
EndFunc   ;==>BlinkerOff

Func CheckBlinker()
    If $Blinker = True Then
        $During_Minimize = _INetGetSource("http://win7vista.com/chat/?ajax=true")
        If $Before_Minimize <> $During_Minimize Then
            _WinAPI_FlashWindowEx($ChatForm, 6)
        EndIf
    EndIf

EndFunc   ;==>CheckBlinker

Func ChatClose()
    Exit
EndFunc   ;==>ChatClose

Darn the parsing crap...

Download the reproducer here...

http://dl.getdropbox.com/u/78219/OpenSourceCustom/AutoIt/Win7Vista%20Notify/asdasdasdasdasd.au3

Edited by BinaryBrother

Share this post


Link to post
Share on other sites



Darn the parsing crap...

What do you mean the parsing crap? There is nothing wrong with the AutoIt code tags if that's what you're on about.

So let me get this straight, when the smiley is attached, and it goes to the IE control it doesn't run anymore?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

James, yes there is a small issue with the AutoIt tags... No big deal... and I'm not worried about it...

Posted Image

<-- That is not what I pasted in... --->

So let me get this straight, when the smiley is attached, and it goes to the IE control it doesn't run anymore?

The topic couldn't have been any better explained... Contains a Video as well, which is all of 600KB...

When any of those emoticons are clicked, inside that reproducer posted above... All GIF animations, stop animating...

Edited by BinaryBrother

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I ran your reproducer, logged in with username aaaaaaaaaaaaa, no password

I do not see the animated gif in the list of smileys. I added it as (img)http://win7vista.com/Smileys/custom/icon_axe.gif{/img) (with square brackets) and submitted... it showed in the message area. I cliked on it and it didn't stop, but it did open a new browser window with that gif running in it.

So, your reproducer isn't doing it for me... your thoughts?

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The reproducer posted does not work, the one in the link does because the AutoIt tags stripped stuff... and replaced it with No-Parse... :D

Please note lines 27,28, and 29... I used a sleep to wait for the chat to load, 20 seconds... If that wasn't enough... You may need to add a few more seconds, and also note that as said earlier the posted reproducer does not work because the AutoIt tags stripped stuff.

Yes, I do know thats a terrible way of doing it, but should be fine for a reproducer test...

http://dl.getdropbox.com/u/78219/OpenSou...t/Win7Vista%20Notify/asdasdasdasdasd.au3

Edited by BinaryBrother

Share this post


Link to post
Share on other sites

Sigh, I used the link you provided, not the code you posted.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Then up the sleep time because obviously the chat interface isn't loaded by the time the event after sleep fires...

Replace sleep(20000)

With Sleep(40000) and wait 40 seconds (After login minus the time it took to login), that should be plenty enough time for you to get the chat interface loaded, past login...

Edited by BinaryBrother

Share this post


Link to post
Share on other sites

Sorry. If I have to study and tweak your code in order to reproduce your problem, you have not provided a reproducer and you are not making good use of my time. If you want help, at least mine, then YOU need to modify the sleep time or whatever needs to be done and make it available again.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Using the interesting method proposed by zackrspv, this avoids your problem. You'll need to play with window resizing, but if you expand the main window you'll see the gif stays animated...

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Inet.au3>
;#include <FTP.au3>
#include <ScreenCapture.au3>
#include <Misc.au3>
#include <WinAPI.au3>

#include <WinAPI.au3>
#include <Constants.au3>

Opt("GUIOnEventMode", 1)
Opt("GUIResizeMode", 1)

;$oIE = _IECreateEmbedded()
$ChatForm = GUICreate("Win7Vista Chat", 800, 650, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
;$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 800, 600)

$oIE = _IECreate2(800, 600, $ChatForm, "http://chat.ecobytes.net/")

$PCInfo = GUICtrlCreateButton("Send PC Info", 5, 603, 105, 41, $WS_GROUP) ; +115 to the left for new buttons
GUICtrlSetResizing($PCInfo, 768 + 8 + 2)
$SendShotFS = GUICtrlCreateButton("Send Screenshot", 120, 603, 105, 41, $WS_GROUP)
GUICtrlSetResizing($SendShotFS, 768 + 8 + 2)
$Options = GUICtrlCreateButton("Options", 235, 603, 105, 41, $WS_GROUP)
GUICtrlSetResizing($Options, 768 + 8 + 2)
_IENavigate($oIE, "http://chat.ecobytes.net/", 1)
GUISetState(@SW_SHOW, $ChatForm)
GUISetOnEvent($GUI_EVENT_CLOSE, "ChatClose")
;GUICtrlSetResizing($GUIActiveX, $GUI_DOCKBORDERS)
Sleep(40000)
$oBody = _IEGetObjByName($oIE, "emoticonsContainer", 0)
_IEDocInsertHTML($oBody, "<a href=""javascript:ajaxChat.insertText('[img]http://win7vista.com/Smileys/custom/icon_axe.gif[/img]');""><img src=""http://win7vista.com/Smileys/custom/icon_axe.gif""></a>", "beforeend")
While 1
    Sleep(250)
WEnd

Func _IECreate2($xWidth, $xHeight, $hGUI, $sURL)
    $pid = Run(@ProgramFilesDir & "\internet explorer\iexplore.exe -k " & $sURL, "", @SW_HIDE)
    Sleep(2000)
    $hHandle = _ProcessGetHWnd($pid)
    $o_ie = _IEAttach($hHandle, "hwnd")
    GUISetState(@SW_SHOW, $hGUI)
    _WinAPI_SetParent($hHandle, $hGUI)
    _WinAPI_MoveWindow($hHandle, 0, 0, $xWidth, $xHeight, True)
    _WinAPI_SetWindowLong($hHandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE)
    _IEAction($o_ie, "refresh")
    Return $o_ie
EndFunc   ;==>_IECreate2

Func _ProcessGetHWnd($iPid, $iOption = 1, $sTitle = "", $iTimeout = 2000)
    Local $aReturn[1][1] = [[0]], $aWin, $hTimer = TimerInit()
    While 1
        $aWin = WinList($sTitle)
        For $i = 1 To $aWin[0][0]
            If $iPid = WinGetProcess($aWin[$i][1]) Then
                If $iOption = 1 Or ($iOption = 0 And $aWin[$i][0] <> "") Then
                    Return $aWin[$i][1]
                ElseIf $iOption = 2 Then
                    ReDim $aReturn[UBound($aReturn) + 1][2]
                    $aReturn[0][0] += 1
                    $aReturn[$aReturn[0][0]][0] = $aWin[$i][0]
                    $aReturn[$aReturn[0][0]][1] = $aWin[$i][1]
                EndIf
            EndIf
        Next
        If $iOption = 2 And $aReturn[0][0] > 0 Then Return $aReturn
        If TimerDiff($hTimer) > $iTimeout Then ExitLoop
        Sleep(Opt("WinWaitDelay"))
    WEnd
    SetError(1)
    Return 0
EndFunc   ;==>_ProcessGetHWnd

Func ChatClose()
    Exit
EndFunc   ;==>ChatClose

Dale

Edit: Updated to more reliably return IE object and to fix sizing issues

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I have quite a bit of time invested in a 1500 line script, half of which relies on the IE UDF (Thanks btw Dale). How will using IE in Kiosk mode effect the UDF? I've noticed that it seams to handle the same way, is there anything I should know, or look out for before I start the conversion process?

Will this Kiosk mode utilize the IE UDF properly?

Share this post


Link to post
Share on other sites

The IE.au3 functions will not care - it is just another browser instance. What you are doing here is simply replacing GuiCtrlCreateObj() with the WinApi calls (changes how the browser is displayed in the AutoIt GUI) and replacing the Webbrowser object created with _IECreateEmbedded with a full InternetExplorer object using the kiosk mode.

I expect it to work well - actually better than the Webbrowser object and GuiCtrlCreateObj - but it has not gotten much testing. So, how well it behaves attached to the AutoIt Gui in this manner is yet to be seen, but I have been very happy with what we've seen so far. Beyond this, I can't say.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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