﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1922	Shell.Explorer.2-Object and cancel Navigation with BeforeNavigate2 fails	card0384@…		"; Test script to embed an Shell.Explorer.2 (MS WebBrowser) control into an AutoIt GUI
;
; Reference for the BeforeNavigate2 event under: http://msdn.microsoft.com/en-us/library/aa768326(VS.85).aspx
;
; Error description:
; In order to have the full functionallity of the BeforeNavigate2 event it is needed to have the $IECancel paramter read and writeable. This parameter
; is documented as read and writeable but it is nowwhere documented how this is done in AutoIt. So I've tried to the ByRef keyword and this causes a
; crash of AutoIt. The Code below will reproduce this crash and when the ByRef keyword is removed then the code will work but there is still no possibillity
; to cancel the navigation.

#include <GUIConstants.au3>                                      ; Begin of the main code
$oIE = ObjCreate (""Shell.Explorer.2"")                            ; create Shell.Explorer.2 object
$GUI = GUICreate (""Embedded IE-Webbrowser"", 830, 500, -1, -1 )   ; Create a simple GUI
GUISetState()
$GUIIE = GUICtrlCreateObj ($oIE, 1, 1 , 829 , 499)               ; embed Shell.Explorer.2 object in GUI
$oIEEvents = ObjEvent ($oIE,""IEEvent"",""DWebBrowserEvents2"")      ; Assign events to functions starting with IEEvent
$oIE.navigate (""www.microsoft.com"")                              ; navigate to www.microsoft.com
While $oIE.busy
 Sleep (30)                                                      ; Idle around while site is loading
Wend

Sleep (5000)                                                     ; Sleep vor 5 seconds and then ...
Exit                                                             ; ... exit
; End of the main code

; Event: Will be called before a navigation starts
Func IEEventBeforeNavigate2 ($IEpDisp, $IEURL, $IEFlags, $IETargetFrameName, $IEPostData, $IEHeaders, ByRef $IECancel) ; Remove ByRef and it will work
 $IECancel = True                                                ; Dummy - Until I add other code
EndFunc"	Bug	closed		AutoIt	3.3.6.1	None	Wont Fix		
