Search Results

Search found 53 results on 3 pages for 'mshtml'.

Page 1/3 | 1 2 3  | Next Page >

  • MSHTML - Auto Click for javascript confirm dialog

    - by Soliton
    I try to automatically parse/submit web page using MSHTML (in C#.Net 3.1 WPF WebBrowser control). I can fill the forms, click buttons, naviagate pages without problems. But do not know how to automatically click "ok" button on javascript confirmation dialog which appear when I click "Submit" button. C# code: mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)webBrowser.Document; mshtml.IHTMLFormElement form = doc.forms.item("inputForm", 0) as mshtml.IHTMLFormElement; mshtml.IHTMLElement btnSubmit = form.item("btnFormSubmit", null) as mshtml.IHTMLElement; btnSubmit.click(); The confirmation dialog ("Are you sure?" appears. I want somehow to send "Enter" keystroke to MSHTML document to automatically confirm the submission.

    Read the article

  • How to set entire HTML in MSHTML?

    - by douglaslise
    How to set entire HTML in MSHTML? I am trying using this assignment: (Document as IHTMLDocument3).documentElement.innerHTML := 'abc'; but I got the error: "Target element invalid for this operation" I tried also using (Document as IHTMLDocument2).write but this form only adds html into the body section, and I neet to replace all the HTML source. Somebody has any idea how I do this? Thanks in advance.

    Read the article

  • Do the new NoPIA and Type Equivalence features in C#/.NET 4.0 mean Microsoft.mshtml.dll is no longer

    - by jpierson
    I'm maintaining a WPF based application which contains a WinForms based WebBrowser control that based on the IE web browser control. When we deploy, we have had to also supply Microsoft.mshtml.dll and do some custom configuration stuff for our ClickOnce publishing process as well in order to get things to work. I'm curious that with the new NoPIA and Type Equivalence features and dynamic type capabilities in C# 4.0 can we expect that if we upgrade that we can remove the dependencies on the Microsoft.mshtml.dll assembly? If so this will not only reduce the size of our deployment quite a bit but will also simplify our publishing process as well. It is my understanding that we should be able embed the types that normally get automatically generated into extra assemblies for COM types such as the MapPoint Control by Visual Studio. I don't know if this also applies to the Microsoft.mshtml.dll or even how it is done even in the most simple of cases. If somebody could provide an explanation about what the practical impact of these new features are on a project that relies on COM interop and especially the Microsoft.mshtml.dll assembly it would be of great help to me.

    Read the article

  • mshtml.dll latest version for Internet Explorer 8, Windows XP Service Pack 3

    - by AllSolutions
    Many applications in my system (Internet Explorer 8, Yahoo Messenger, Skype 10) are crashing and error details shows module name mshtml.dll. I checked the version of mshtml.dll in system32 folder. It is 8.0.6001.19170. My Internet Explorer version is 8.0.6001.18702. I am not concerned about crash of IE, because I generally use Firefox, but how do I solve the crashes in other applications, which are due to mshtml.dll? I have moved to Windows XP Service Pack 3 (32 bit). I have tried to update Internet Explorer 8 (from Tools-Windows Update), but again it crashes. I can not migrate to IE 9, as it requires Vista or Windows 7. I have applied Cumulative Security update for IE8, which has this file name: IE8-WindowsXP-KB2618444-x86-ENU.exe I could not get much info from Microsoft sites or Google. I do not want to use Automatic Updates feature of Windows. Can somebody give the download links for mshtml.dll and any associated files, which I can replace in system32 folder? Thanks.

    Read the article

  • There is another way to load MSHTML documents without use Application.ProcessMessages?

    - by douglaslise
    There is another way to load MSHTML documents without use Application.ProcessMessages? To load a document into a IHTMLDocument I need to do this: while Doc.readyState <> 'complete' do Application.ProcessMessages; I want not to process all the message queue during the loading, because I would be changing my application flow, in other words, some messages that should be processed after the loading to be completed can be processed earlier, even before the loading end. There is a special message code that the IHTMLDocument expect to advance in the loading process? Or there is another way to load? Thanks.

    Read the article

  • There are another way to load MSHTML documents without use Application.ProcessMessages?

    - by douglaslise
    There are another way to load MSHTML documents without use Application.ProcessMessages? To load a document into a IHTMLDocument I need to do this: while Doc.readyState <> 'complete' do Application.ProcessMessages; I want not to process all the message queue during the loading, because I would be changing my application flow, in other words, some messages that should be processed after the loading to be completed can be processed earlier, even before the loading end. There is a special message code that the IHTMLDocument expect to advance in the loading process? Or there is another way to load? Thanks.

    Read the article

  • Setting HTML Text Element value

    - by Gpx
    Hi, in my C# WPF prog i´am trying to set a value of a HTML Text Element which is defined like: <input name="tbBName" type="text" id="tbBName" tabindex="1" /> What i found about it and tried is: mshtml.HTMLDocument doc = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.HTMLInputTextElement tbName = (mshtml.HTMLInputTextElement)doc.getElementsByName("tbBName"); tbName.value = "Test"; But i got the exception: Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLInputTextElement'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F520-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). I know what it says but i dont know which object i can use to access the Texbox. Thanks for any answers.

    Read the article

  • Internet Explorer Automation: how to suppress Open/Save dialog?

    - by Vladimir Dyuzhev
    When controlling IE instance via MSHTML, how to suppress Open/Save dialogs for non-HTML content? I need to get data from another system and import it into our one. Due to budget constraints no development (e.g. WS) can be done on the other side for some time, so my only option for now is to do web scrapping. The remote site is ASP.NET-based, so simple HTML requests won't work -- too much JS. I wrote a simple C# application that uses MSHTML and SHDocView to control an IE instance. So far so good: I can perform login, navigate to desired page, populate required fields and do submit. Then I face a couple of problems: First is that report is opening in another window. I suspect I can attach to that window too by enumerating IE windows in the system. Second, more troublesome, is that report itself is CSV file, and triggers Open/Save dialog. I'd like to avoid it and make IE save the file into given location OR I'm fine with programmatically clicking dialog buttons too (how?) I'm actually totally non-Windows guy (unix/J2EE), and hope someone with better knowledge would give me a hint how to do those tasks. Thanks! UPDATE I've found a promising document on MSDN: http://msdn.microsoft.com/en-ca/library/aa770041.aspx Control the kinds of content that are downloaded and what the WebBrowser Control does with them once they are downloaded. For example, you can prevent videos from playing, script from running, or new windows from opening when users click on links, or prevent Microsoft ActiveX controls from downloading or executing. Slowly reading through... UPDATE 2: MADE IT WORK, SORT OF... Finally I made it work, but in an ugly way. Essentially, I register a handler "before navigate", then, in the handler, if the URL is matching my target file, I cancel the navigation, but remember the URL, and use WebClient class to access and download that temporal URL directly. I cannot copy the whole code here, it contains a lot of garbage, but here are the essential parts: Installing handler: _IE2.FileDownload += new DWebBrowserEvents2_FileDownloadEventHandler(IE2_FileDownload); _IE.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandler(IE_OnBeforeNavigate2); Recording URL and then cancelling download (thus preventing Save dialog to appear): public string downloadUrl; void IE_OnBeforeNavigate2(Object ob1, ref Object URL, ref Object Flags, ref Object Name, ref Object da, ref Object Head, ref bool Cancel) { Console.WriteLine("Before Navigate2 "+URL); if (URL.ToString().EndsWith(".csv")) { Console.WriteLine("CSV file"); downloadUrl = URL.ToString(); } Cancel = false; } void IE2_FileDownload(bool activeDocument, ref bool cancel) { Console.WriteLine("FileDownload, downloading "+downloadUrl+" instead"); cancel = true; } void IE_OnNewWindow2(ref Object o, ref bool cancel) { Console.WriteLine("OnNewWindow2"); _IE2 = new SHDocVw.InternetExplorer(); _IE2.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandler(IE_OnBeforeNavigate2); _IE2.Visible = true; o = _IE2; _IE2.FileDownload += new DWebBrowserEvents2_FileDownloadEventHandler(IE2_FileDownload); _IE2.Silent = true; cancel = false; return; } And in the calling code using the found URL for direct download: ... driver.ClickButton(".*_btnRunReport"); driver.WaitForComplete(); Thread.Sleep(10000); WebClient Client = new WebClient(); Client.DownloadFile(driver.downloadUrl, "C:\\affinity.dump"); (driver is a simple wrapper over IE instance = _IE) Hope that helps someone.

    Read the article

  • Modify HTML in a Internet Explorer window using external.menuArguments

    - by Axeman
    Hi all... I've a vb.net class that is invoked with a context menu extension in Internet Explorer. The code has access to the object model of the page, and reading data is not a problem. This is the code of a test funcion... it changes the status bar text (OK), prints the page html (OK), changes the html by adding a text and prints again the page html (ok, in the second popup my added text is in the html) But the Internet Explorer window doesnt't show it. Where am I doing wrong? Public Sub CallingTest(ByRef Source As Object) Dim D As mshtml.HTMLDocument = Source.document Source.status = "Working..." Dim H As String = D.documentElement.innerHTML() MsgBox(H) D.documentElement.insertAdjacentText("beforeEnd", "ThisIsATest") H = D.documentElement.outerHTML() MsgBox(H) Source.status = "" End Sub Function is called by this javascript: <SCRIPT> var EB = new ActiveXObject("MyObject.MyClass"); EB.CallingTest(external.menuArguments); </SCRIPT>

    Read the article

  • How to determine direction of navigation from IE WebBrowser (IHtmlWindow2 or Javascript)

    - by Geoff Cox
    I'm uisng the WPF Web Browser control and when it fires the Navigating event, the event args always contain NavigationMode.New. It should be set to NavigationMode.Back if the user chooses to 'Go Back' from the web control. So its off to the COM ActiveX control underneath to determine the direction of navigation. I've been looking at IHtmlWindow2 and IHtmlDocument2 and IOmHistory, but don't see anything that happens on navigation to tell me if the navigation is caused by going back, forward, a new address, or a refresh. Since IHtmlWindow and Javascript have the same DOM, maybe someone knows how from Javascript. I've also been looking at the IWebBrowser2 interface, but can't find anything there either. Is there an event or property I need to inspect?

    Read the article

  • HTML - How do I know when all frames are loaded?

    - by Yuval Peled
    I'm using .NET WebBrowser control. How do I know when a web page is fully loaded? I want to know when the browser is not fetching any more data. (The moment when IE writes 'Done' in its status bar...). Notes: The DocumentComplete/NavigateComplete events might occur multiple times for a web site containing multiple frames. The browser ready state doesn't solve the problem either. I have tried checking the number of frames in the frame collection and then count the number of times I get DocumentComplete event but this doesn't work either. this.WebBrowser.IsBusy doesn't work either. It is always 'false' when checking it in the Document Complete handler.

    Read the article

  • How to make TWebBrower ignore accelerator chars of others controls?

    - by douglaslise
    I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption setted to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle keys (e.g. TButton). How can I solve this? Thanks in advance.

    Read the article

  • Saving webpage content using webbrowser IHTMLDocument interface

    - by Ramanand Bhat
    Hi, We need to save the complete web page including img, javascript, css and html using ATL webbrowser (IHTMLDocument) control, using IHTMLDocument2::get_all() method we have saved .html file but now how do we get external files such as .css, javascript and image files please help us with methods that internet explorer or firefox used to save the web page locally. Thanks, Ramanand.

    Read the article

  • How to make TWebBrowser ignore accelerator chars of others controls?

    - by douglaslise
    I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption set to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle keys and/or don't accept chars (e.g. TButton). How can I solve this? Thanks in advance.

    Read the article

  • Hooking the http/https protocol in IE causes GET requests to be sequential

    - by watsonmw
    I'm using the PassthruAPP method to hook into HTTP/HTTPS requests made by IE. It's working well for the most part, however I noticed a problem. Only one download thread is active at a time. I can see two IInternetProtocol objects getting created, but IE uses only one at a time. This is happening with IE7. The odd thing is that the problem occurs when overriding the existing default HTTP/HTTPS handler, even if the handler is not the one being used to make the request. E.g. Registering a handler for the HTTPS protocol will cause HTTP requests to be made sequentially, even though HTTP requests are not hooked. I installed Google Gears and it has the same problem. This always happens for the first few items on the page, but it seems that after the document complete is issued, concurrent downloads can occur again. For example Javascript code that is executed after the page has finished loading can load images concurrently just fine. One option is to try to IAT patch the 'IInternetProtocol' registered for HTTP requests, but Google Gears does this already and it has the same problem. I know installing a HTTP Proxy is another option, but I don't want to monkey with the users' HTTP Proxy settings if there another option.

    Read the article

  • IWebBrowser: How to specify the encoding when loading html from a stream?

    - by Ian Boyd
    Using the concepts from the sample code provided by Microsoft for loading HTML content into an IWebBrowser from an IStream using the web browser's IPersistStreamInit interface: HRESULT LoadWebBrowserFromStream(IWebBrowser* pWebBrowser, IStream* pStream) { [snip] } How can one specify the encoding of the html inside the IStream? The IStream will contain a series of bytes, but the problem is what do those bytes represent? They could, for example, contain bytes where: each byte represents a character from the current Windows code-page (e.g. 1252) each byte could represent a character from the ISO-8859-1 character set the bytes could represent UTF-8 encoded characters every 2 bytes could represent a character, using UTF-16 encoding In my particular case, i am providing the IWebBrowser an IStream that contains a series of double-bytes characters (UTF-16), but the browser (incorrectly) believes that UTF-8 encoding is in effect. This results in garbled characters.

    Read the article

  • Why does this window object not have the eval function?

    - by Motti
    I ran into an interesting (?) problem in the YUI rich edit demo on IE. When looking at the window object for the content editable frame used as the browser I see that the eval function is undefined (by running the following). javascript:alert(document.getElementById("editor_editor").contentWindow.eval) This only happens on IE (I checked on IE6 and IE8), and it doesn't happen on Firefox or Chrome. All the other window functions and properties seem to be in order, now I realise that eval is not really defined on the window but on the global object but my understanding was that in browsers the window is the global object (also eval does appear on all other windows so why not on this one?). Does anyone know if this is a know bug/limitation in IE and how I can get to eval in the context of the global object of this frame? (I need the side effects to be available to anything running from within this frame).

    Read the article

  • How can I call a method on a custom object created in JavaScript using C#?

    - by just in case
    I have a WebBrowser control. I have added some JavaScript into the head tag and I can see it is working as expected by adding an alert. Inside of this js I am creating a function and adding some members to it's prototype like so: function test() { } test.prototype.run = function() { alert('success!') } function createTest() { return new test() } Then back inside of C# I am doing: dynamic test = this.browser.InvokeScript("createTest"); test.run(); I can see that the test object is some ComObject but when I call run() nothing happens. I get no error but nothing happens. Does anyone know how to call this type of custom object? Also suppose I wanted to get rid of the createTest() method, how can I create a new instance of test from C#? Also, for bonus points, is there anything special I need to know about attaching events to this custom object (on say a 'complete' member) such that it will callback into my C# code?

    Read the article

1 2 3  | Next Page >