Jump to content

_IECreateEmbedded and AnimateWindow


Tec
 Share

Recommended Posts

Hi

I have a prob with Website load and Animatewindow. I try to make a Website presentation. 2 Guis that load the website in background and then use AnimateWindows from user32.dll to fade in. But on the top i have a blank bar. Dont know how to fix this.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <file.au3>

GUIRegisterMsg($WM_ACTIVATEAPP, "_ToggleHotkeys")
Dim $WERBUNG
Local $I = 1, $COUNT, $activ = 1

$oIE1 = _IECreateEmbedded ()
$oIE2 = _IECreateEmbedded ()

Global $GUI1 = GUICreate("Test1", @DesktopWidth, @DesktopHeight+30, -1, -1, $WS_POPUP,  $WS_EX_TOPMOST)
$GUIActiveX1 = GUICtrlCreateObj($oIE1, 0, 30, @DesktopWidth+18, @DesktopHeight)

Global $GUI2 = GUICreate("Test2", @DesktopWidth, @DesktopHeight+30, -1, -1, $WS_POPUP,  $WS_EX_TOPMOST)
$GUIActiveX2 = GUICtrlCreateObj($oIE2, 0, 30, @DesktopWidth+18, @DesktopHeight)

GUISetState()
    
_FILEREADTOARRAY(@ScriptDir & "\list.txt", $WERBUNG)
$COUNT = $WERBUNG[0]
_IENAVIGATE($OIE1, "about:blank")   
_IENAVIGATE($OIE2, "about:blank")   

$BEGIN = TimerInit()
While 1
    If TimerDiff($BEGIN) >= 5000 Then
        If $I > $COUNT Then $I = 1
        IF $activ = 1 then 
            _IENAVIGATE($oIE1, $WERBUNG[$I],1)
            WinActivate($gui1)
            DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $GUI1, "int", 4000, "long", 0x00080000 )
            ;WinSetState($GUI1, "", @SW_SHOW)
            WinSetState($GUI2, "", @SW_HIDE)
            ;DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $GUI2, "int", 3000, "long", 0x00090000 )
            $activ = 0 
        else 
            _IENAVIGATE($OIE2, $WERBUNG[$I],1)
            WinActivate($gui2)
            DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $GUI2, "int", 4000, "long", 0x00080000 )
            ;WinSetState($GUI2, "", @SW_SHOW)
            WinSetState($GUI1, "", @SW_HIDE)
            ;DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $GUI1, "int", 3000, "long", 0x00090000 )
            $activ = 1
        EndIf
        $BEGIN = TimerInit()
        $I += 1
    EndIf   
    Sleep( 100 )
WEnd

Func _ToggleHotkeys()
    If WinActive($GUI1) Or WinActivate($GUI2) Then
        HotKeySet("{Esc}","_Exit")
    Else
        HotKeySet("{Esc}")
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

list.txt

Edited by Tec
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...