Miroslav, > I used a htmlviewer component as a main component of the browser. It > works great, but how do I force this component to open popups just like IE? > > javascript: > window.open('http://google.com','google',width=400,height=300'); > > Is there any way to teach my application to open whis window made by > javascript code with the width and height?
You will have to play around with this to get it to work cleanly, it is from http://www.boisseau.co.uk/blog/?p=41 who gives credit to Jon Johnson of REAL, I'll pass it along here. I use a Mac and have not tested this on a Windows machine. In a Module add, Sub EvaluateWebScript(Extends html As HTMLViewer, script As String) #If TargetMacOS Soft Declare Function sel_registerName lib "/usr/lib/libobjc.dylib" _ (name as CString) as Integer Soft Declare Function objc_msgSend lib "/usr/lib/libobjc.dylib" _ (obj as Integer, selector as Integer, StrParam as CFStringRef) As Integer Soft Declare Function objc_msgSend lib "/usr/lib/libobjc.dylib" _ (obj as Integer, selector as Integer) As Integer Soft Declare Function HIWebViewGetWebView lib "WebKit" _ (hiview as Integer) as Integer Dim webView as Integer = HIWebViewGetWebView( html.Handle ) Dim win As Integer = objc_msgSend( webView, sel_registerName("windowScriptObject") ) Static selector as Integer = sel_registerName( "evaluateWebScript:" ) Dim result As Integer = objc_msgSend( win, selector, Script) #Else html.LoadURL("javascript:+Script") #EndIf End Sub >From your HtmlViewer you call it like this (watch for word wrap), Dim aScript As String aScript = "window.open('http://www.google.com/', 'Google','width=400,height=300')" HTMLViewer1.EvaluateWebScript aScript This sort of works for me, my window resizes but the result is a strangely drawn window. You may have to give this script more parameters to eliminate this. Perhaps this will get you going in the right direction. HtmlViewers and Rb windows don't always play well together, at least for me they do not. -- Thomas C. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>