shdocvw

How do I open maximized internet explorer?

只谈情不闲聊 提交于 2020-01-02 05:28:13
问题 I have to open maximized internet explorer using C#. I have tried the following: try { var IE = new SHDocVw.InternetExplorer(); object URL = "http://localhost/client.html"; IE.ToolBar = 0; IE.StatusBar = true; IE.MenuBar = true; IE.AddressBar = true; IE.Width = System.Windows.Forms.SystemInformation.VirtualScreen.Width; IE.Height = System.Windows.Forms.SystemInformation.VirtualScreen.Height; IE.Visible = true; IE.Navigate2(ref URL); ieOpened = true; break; } catch (Exception) { } I can open

Force SHDocVw.InternetExplorer 32bit instead of 64bit in Windows 7-64

倖福魔咒の 提交于 2019-12-24 09:59:29
问题 I'm using SHDocVw.InternetExplorer to open an IE window and control the session. Mostly to automate going to a certain page, logging in, checking for certain data, etc. It works great, except that we're supposed to be using this internet explorer add-on extension now, and when my program spawns the window most of the add-ons aren't listed under Tools->Manage Add-Ons Is there anything I can try to load in at least this one extension? Edit: Ok, So I think I may have narrowed down what's going

System.InvalidCastException: Specified cast is not valid

橙三吉。 提交于 2019-12-24 05:05:00
问题 Automation using WatiN is being carried out. Using couple of simultaneous threads to test the application. Few threads are failed and log report/stack trace says the following. System.InvalidCastException: Specified cast is not valid. at SHDocVw.IWebBrowser2.get_HWND() at WatiN.Core.Native.InternetExplorer.IEBrowser.get_hWnd() at WatiN.Core.Browser.get_hWnd() at WatiN.Core.DomContainer.StartDialogWatcher() at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler,

Any workaround to get text in an iFrame on another domain in a WebBrowser?

混江龙づ霸主 提交于 2019-12-22 06:56:05
问题 You will probably first think is not possible because of XSS restrictions. But I'm trying to access this content from an application that hosts a WebBrowser , not from javascript code in a site. I understand is not possible and should not be possible via non hacky means to access this content from javascript because this would be a big security issue. But it makes no sense to have this restriction from an application that hosts a WebBrowser . If I'd like to steel my application user's

VBA Internet Explorer Automation 'Permission Denied'

孤街浪徒 提交于 2019-12-20 03:39:08
问题 Dim IE as New InternetExplorer IE.Visible = True IE.Navigate("http://www.google.com") Do Until IE.Busy = False Loop IE.document.getElementsByTagName("Input")(3).Value = "Search Term" IE.document.Forms(0).Submit <------ This line results in error. The error states Run-time error 70: 'Permission Denied' Please do not suggest code alterations. There is NOTHING wrong with the code. This macro works on 9 out of 10 computers. It is NOT a timing issue (I still get the error even if I step through

Distinguishing IE windows from other windows when using SHDocVw

余生颓废 提交于 2019-12-12 05:27:18
问题 How can I distinguish IE shell windows from non IE shell windows? I've got the following snippet of code (Lot's or extraneous logic removed) that uses the ShellWindows object to scan the open windows to see what URL the user is browsing, with the intention of doing something if they have browsed to a particular URL: // Shell Windows object obtained in another method private ShellWindows shellWindows = new ShellWindows(); ... // iterate through all windows foreach (SHDocVw.IWebBrowser2

WebBrowser.Document property getter throws UnauthorizedAccessException

感情迁移 提交于 2019-12-11 17:59:26
问题 We have a Windows Forms app that hosts a web application from http://localhost (on a port selected at runtime) in a WebBrowser control which mostly works fine. Within the webapp there is a 'help' link that pops up a new window, and we handle this by listening to the NewWindow event and showing the help URL in another WebBrowser control within another Form/Window, this also mostly works fine. The problem is that the html help files are generating script errors which cause annoying popup error

c# specified cast is not valid while assigning mshtml.HTMLDocument.frames

℡╲_俬逩灬. 提交于 2019-12-11 03:34:49
问题 I'm developing an IE BHO, While accessing frames in a html document i'm getting this error Here is the code. foreach (SHDocVw.InternetExplorer objExplorer in objShellWins) { if (objExplorer.Document is HTMLDocument) { objDocument = (mshtml.HTMLDocument)objExplorer.Document; mshtml.HTMLDocument doc = (mshtml.HTMLDocument)objExplorer.Document; mshtml.FramesCollection frames = (mshtml.FramesCollection)doc.frames; //Exception at this line } } what is the issue here ? 回答1: OK people i got it

Identify all open System/Special Folders

烂漫一生 提交于 2019-12-10 17:46:58
问题 I am currently using the following to Get Path in a ListBox of all Open Explorer Windows: foreach (SHDocVw.InternetExplorer j in new SHDocVw.ShellWindows()) { if (j.Name == "Windows Explorer") { ListView1.Items.Add(j.LocationURL); } } But it doesn't return the location of special folders like Computer, Recycle Bin, Network etc. Is there a way to identify those folders so I can put the path on my own like shell:MyComputerFolder for Computer? 回答1: You need to use the Environment.GetFolderPath

How can I maximize an IE window created by VBA with SHDocVw.InternetExplorer command?

冷暖自知 提交于 2019-12-08 03:47:16
问题 As the title says, I'm trying to maximize an internet explorer window that was created using the following command: Set ie = New SHDocVw.InternetExplorer Instead of: Set ie = CreateObject("InternetExplorer.Application") Here's the full code: Sub wpieautologin() Dim ie As SHDocVw.InternetExplorer Dim NOME_EMPRESA, CNPJ, CPF, COD_ACESSO As String Dim Lookup_Range As Range Set ie = New SHDocVw.InternetExplorer ie.Visible = False ie.Navigate "http://www8.receita.fazenda.gov.br/simplesnacional