webbrowser-control

Convert HTML in CWebBrowser2 element into VECTOR metafile

I have tested a number of solutions to capture the HTML content of a CWebBrowser2 element into a vector metafile. I can get either part of the web page as vector emf, or I can get all of the webpage as a raster bitblt wrapped in an emf wrapper. What I want is All of the webpage as vector with only original bitmaps, flash, etc represent...

Issues retrieving selected text from IE browser

I'm creating a IE browser plug-in that needs to be kept updated about what text has been selected by the user, or if no text is currently selected at all. I learned how to get the selected text by reading here. This is my code for doing so: var doc = browser.Document as IHTMLDocument2; var selection = doc.selection as IHTMLSelectionO...

my website doesnt look the same in all browsers? it looks right in safari but not IE or firefox

anyone have the code to ger websites to look right in IE and firefox? ...

Implementing Drag and Drop Functionality WebBrowser Control Winforms C#

I need to capture drag and Drop Events of WebBrowser Control in WinForm C#. Is there any way ? ...

Application Framework Compatibility Issues and COM/Webbrowser Controls

SetOleClientSite() is not working as intended (*doesn't call IDispatch_Invoke_Handler()*) when enable "Application Framework" in VB.NET 3.5 We created a test example exact same code. When we enable "Application Framework" IDispatch_Invoke_Handler works when we disable, it doesn't. There is no mention of COM incompatibility of similar i...

Get Byte Offset of selected Word in WebBrowser Control

How to fetch Byte Offset of selected word in WebBrowser Control. ...

Search text in WebBrowser Control WinForms C#

I want to get occurence count of selected text in WebBrowser Control ...

WPF - Send mouse wheel messages to a Frame/WebBrowser control

I'm hosting some web content in a WPF app using the WebBrowser control (or Frame, havent' decided yet). There are some external influences that I'd like to use to simulate mouse wheel behavior in the web content. Is there a way for my WPF app to send mouse messages to the WebBrowser control, with a Delta (scroll) value that I specify? ...

Is there an MVVM-friendly way to use the WebBrowser control in WPF?

Thanks to this question (click me!), I have the Source property of my WebBrowser binding correctly to my ViewModel. Now I'd like to achieve two more goals: Get the IsEnabled property of my Back and Forward buttons to correctly bind to the CanGoBack and CanGoForward properties of the WebBrowser. Figure out how to call the GoForward() a...

Protect IE6 from exploits when testing?

I wrote an app in C# which uses the webbrowser control. While using it, the site i happen to use it on had an ad that auto DLed and ran itself on my comp causing me to be very annoyed. According to safebrowsing.clients.google.com 2/5000 pages had this exploit, unlucky me. I use IE6 for testing so what can i do to protect myself from tho...

WebBrowser control in windows form application using C#

Hello everyone. I am trying to create a form with webbrowser control. I am trying to open a local html file in the webbrowser control. I have the html file in Help_Print folder, so I am using the code below to specify the Url of the webbrowser. wbPrint.Url = new Uri("file:///" + Application.StartupPath + "\\Help_Print\\help.html"); Wh...

Create a Custom Component which have WebBrowser and Grid C# Windows App

I have an interface which return a Control based on File Name for example if there's an html file I am returing an Instance of WebBrowser Componet. This WebBrowser Component inherits from WebBrowser Class. I need to update this component so that it can accomodate a grid as well. What Should I do ? I am working on Windows Application ...

WebBrowser control and ready state

I am using a webbrowser control to login to a website. WbBrowser.Navigate("http://www.foo.com/login.php") Once the page is loaded I login using the following code While WbBrowser.ReadyState <> WebBrowserReadyState.Complete Application.DoEvents() End While WbBrowser.Document.GetElementById("user_login").SetAttribu...

How to Highlight a specific word in WebBrowser control C#

I have a webbrowser control and I am able to get the selected word by the user. I am saving this word in a file and with it I am also saving its byte offset and length. Lets says i have some text in my Web browser control as "Hello Hey Hello" lets say the user has selected last hello. Now that word is saved with me along with other inf...

IHTMLSelectionObject.createRange() throws UnauthorizedAccessException

I wrote the following code for retrieving the selected text from the current webpage: IHTMLDocument2 mainDoc = ... for ( int i = 0; i < mainDoc.frames.length; i++ ) { object refIndex = i; var frame = (IHTMLWindow2)mainDoc.frames.item( ref refIndex ); IHTMLDocument2 frameDoc; try { frameDoc = frame.document; } ca...

scraping/simulate browsing help

I want to make a program that will simulate a user browsing a site and clicking on links. Cookies and javascript have to be enabled. I've successfully done this in python, but I want to write it an compilable language (python ide's don't cut it). The links on the site are generated with javascript and are dynamic. With python I used PAMI...

.NETCF 2.0 WebBrowserControl Pocket IE enable JavaScript

Need help to get Pocket IE configured to execute javascript in WebBrowser Control from a VB app. Get message that security settings for Pocket IE do not authorize scripts. Is it possible to configure Pocket IE on .NET CF 2.0 to execute client side scripts? Thanks in advance and happy coding. ...

WebBrowser Control Select functionality disabled when using mshtml.HTMLDocumentEvents2_Event iEvent

WebBrowser Control Select functionality disabled when using mshtml.HTMLDocumentEvents2_Event iEvent In the Document Complete Event I am binding events to IEvent instance but as soon as I bind these events the selection feature gets disabled. Is there nay way out? ...

Whats the problem in this function C#

I have written the below function to select a numeric string such as 1,23,000.00 In the WebBrowser I am trapping Double_Click Event and then passing the selected range to the below function. lets say the initial selection was 000 and my target is to select the whole string as mentioned above. myRange=doc.selection.createRange() myRange...

Remove Javascript/ChildElement from WebBrowser Control

I am using below code to inject javascript HtmlElement head = _wb.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = _wb.Document.CreateElement("script"); mshtml.IHTMLScriptElement element = (mshtml.IHTMLScriptElement)scriptEl.DomElement; element.text = "function zoom(){do...