i am hosting a webbrowser control in an vb app. if a page contains
javascript window.open position my webbrowser control resizes and moves.
How can i avoid this behaviour? IE6 Events like setwindowleft etc just
don't fire!
i already tried
- subclass the "Internet Explorer_Server" to get WM_poschanging
messages but none ever appeared
- setwindowleft etc events (webbrowser1.move 1,1 -> no effect)
- DOM : in NavigateComplete2() hook the
webbrowser.document.parentWindow.onresize event -> no effect
having no clue
simon
To avoid any such problems, set RegisterAsBrowser property to false.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Simon Bühler" <si...@aktionspotenzial.de> wrote in message
news:3C1EAA6A...@aktionspotenzial.de...
the target for the new popup is on form2.webbrowser1, and i want to show
form2 with custom titlebar / no navbar / no rightclick etc. and no standard
webbrowser window.
my code is on form 1:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim popF As Form2 'contains a webbrowser control
Set popF = New Form2
popF.WebBrowser1.RegisterAsBrowser = True
Set ppDisp = popF.WebBrowser1.Object
popF.Visible = True
end sub
so on form2 i have
Private Sub WebBrowser1_WindowSetLeft(ByVal left As Long)
WebBrowser1.Move 1, 1
End Sub
which never fires when the popup contains someting like
<BODY onLoad="if (window.screen) { window.moveTo(5,
screen.availHeight/4);} ">
(check http://www.techno.de for this popup )
so when the window.moveTo method is called i need to get any event to deal
with.
greetz
simon
Unfortunately, I have not found a way to handle both moveTo and moveBy.
moveTo causes WM_WINDOWPOSCHANGING to be sent with new position
expressed in screen coordinates, and moveBy in client coordinates, and
no indication as to the cause of the move. So I assume that the
coordinates are screen, and document that moveBy behaves erratically and
is not supported.
Before you ask, I have no idea how to subclass a window in VB. I'm a C++
programmer.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Simon Bühler" <si...@aktionspotenzial.de> wrote in message
news:3C1F81CB...@aktionspotenzial.de...