After many hours of searching the forum and head scratching I have failed to work out why the following script freezes.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
;_IEErrorHandlerRegister ()
; Create main window
$hParent = GUICreate("My GUI Tab",600,600)
$idMsgbox = GUICtrlCreateButton("MSGBOX",3,5,100,25)
GUISetState(@SW_SHOW,$hParent)
; create child window
; If next 2 lines are commented out then script does not freeze
$hChild = GuiCreate("Child",550,550,0,30,$WS_CHILD,-1,$hParent)
GUISetState(@SW_SHOW,$hChild)
; Create Embbedded IE Browser
$oIE = _IECreateEmbedded ()
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 500, 500)
$Event = ObjEvent($oIE, "_WebEvent_", "DWebBrowserEvents")
;_IENavigate ($oIE, 'about:blank')
_IENavigate ($oIE, 'www.bbc.co.uk')
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idMsgbox
MsgBox(262144,0,"Button Pressed")
EndSwitch
WEnd
Func _WebEvent_($EventName)
ConsoleWrite($EventName&@crlf)
; MsgBox causes script to freeze if child windows has been created
if $EventName = "DownloadBegin" then MsgBox(262144,0,$EventName)
EndFunc
The script seems to freeze after the fist MsgBox is dsiplayed in the _WebEvent() function.
Also, the problem only occurs if the child GUI is created. If the child GUI is commented out so that the embedded browser is created directly in the parent GUI then then the script is OK.
Has any one got a fix for me please.