Search Results

Search found 29 results on 2 pages for 'iwebbrowser2'.

Page 1/2 | 1 2  | Next Page >

  • IWebBrowser2.Navigate opens second window

    - by Sam Barham
    The following code, on Vista with Internet Explorer 7, opens two windows (the one I create, and then a second one when Navigate is called, which is the one that the file appears in). This doesn't happen in Internet Explorer 8, or on XP as far as I know. Any idea how I can stop it doing that? SHDocVw.InternetExplorerClass ieObject = (SHDocVw.InternetExplorerClass)this.ieObject; if (this.ieObject == null) { ieObject = new SHDocVw.InternetExplorerClass(); this.ieObject = ieObject; } SHDocVw.IWebBrowser2 browserApp = (SHDocVw.IWebBrowser2)this.ieObject; object empty = System.Reflection.Missing.Value; browserApp.Visible = true; User32.SetForegroundWindow(new IntPtr(browserApp.HWND)); browserApp.Navigate(filePath, ref empty, ref empty, ref empty, ref empty);

    Read the article

  • Tab key support in an IWebBrowser2 control

    - by Bob
    I have an embedded IWebBrowser2 control using straight C++ (windowed, not windowless) and when someone hits the Tab key to go between fields in the browser, it jumps focus out of the web browser. Any ideas on what I need to implement or what I could be screwing up? Thanks!

    Read the article

  • Manifest or Theme/Style for a IWebBrowser2 control?

    - by Bob
    The IWebBrowser2 control has password edit boxes which are squares. This happened many years ago if you were on an XP machine, and you had a password edit field without a manifest file, you would get squares (no character found for the * they put in there with that font). My application has a manifest file. However I don't know how to give a manifest or set the theme or style of the control that is created. Any ideas? Thanks!

    Read the article

  • Disable script debugging in IWebBrowser2 OLE control? C++

    - by flyout
    I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE). And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings)?

    Read the article

  • How can I access the JavaScript global object ("window") inside an embedded browser object (the IWebBrowser2 interface)?

    - by John Factorial
    I have an HTML page which embeds an IWebBrowser2 ActiveX (i.e. the control is essentially an Internet Explorer browser). I need to write JavaScript in this HTML page which will remove any window.onresize handler from the page loaded in the IWebBrowser2 control. IWebBrowser2 exposes the DOM through IWebBrowser2::Document, but this is equivalent to window.document. Is there any way I can get access to window or window.onresize?

    Read the article

  • How can I create a WebBrowser control (ActiveX / IWebBrowser2) without a UI?

    - by wangminhere
    I cannot figure out how to use the WebBrowser control without having it create a window in the taskbar. I am using the IWebBrowser2 ActiveX control directly because I need to use some of the advanced features like blocking downloading JAVA/ActiveX/images etc. That apparently is not available in the WPF or winforms WebBrowser wrappers (but these wrappers do have the ability to create the control with no UI) Here is my code for creating the control: Type webbrowsertype = Type.GetTypeFromCLSID(Iid_Clsids.CLSID_WebBrowser, true); m_WBWebBrowser2 = (IWebBrowser2)System.Activator.CreateInstance(webbrowsertype); m_WBWebBrowser2.Visible = false; m_WBOleObject = (IOleObject)m_WBWebBrowser2; int iret = m_WBOleObject.SetClientSite(this); iret = m_WBOleObject.SetHostNames("me", string.Empty); tagRECT rect = new tagRECT(0, 0, 0, 0); tagMSG nullMsg = new tagMSG(); m_WBOleInPlaceObject = (IOleInPlaceObject)m_WBWebBrowser2; //INPLACEACTIVATE the WB iret = m_WBOleObject.DoVerb((int)OLEDOVERB.OLEIVERB_INPLACEACTIVATE, ref nullMsg, this, 0, IntPtr.Zero, ref rect); IConnectionPointContainer cpCont = (IConnectionPointContainer)m_WBWebBrowser2; Guid guid = typeof(DWebBrowserEvents2).GUID; IConnectionPoint m_WBConnectionPoint = null; cpCont.FindConnectionPoint(ref guid, out m_WBConnectionPoint); m_WBConnectionPoint.Advise(this, out m_dwCookie); This code works perfectly but it shows a window in the taskbar. If i omit the DoVerb(OLEDOVERB.OLEIVERB_INPLACEACTIVATE) call, then Navigating to a webpage is not working properly. Navigate() will not download everything on the page and it never fires the DocumentComplete event. If I add a DoVerb(OLEIVERB_HIDE) then I get the same behavior as if I omitted the DoVerb(OLEDOVERB.OLEIVERB_INPLACEACTIVATE) call. This seems like a pretty basic question but I couldn't find any examples anywhere.

    Read the article

  • IWebBrowser2: how to force links to open in new window?

    - by Rob McAfee
    The MSDN documentation on WebBrowser Customization explains how to prevent new windows from being opened and how to cancel navigation. In my case, my application is hosting an IWebBrowser2 but I don't want the user to navigate to new pages within my app. Instead, I'd like to open all links in a new IE window. The desired behavior is: user clicks a link, and a new window opens with that URL. A similar question was asked and answered here and rather than pollute that answered post, it was suggested I open a new discussion. The members on the related post suggested I should be able to do this by trapping DISPID_BEFORENAVIGATE2, setting the cancel flag, and writing code to open a new window, but I've found out that the browser control gets lots of BeforeNavigate2 events that seem to be initiated by scripts on the main page. For example, amazon.com fires BeforeNavigate2 events like crazy, and they are not a result of link invocation. Replies appreciated!

    Read the article

  • Embedding IWebbrowser2 ATL interface control in C# windows mobile smart device application

    - by Ramanand Bhat
    Hi All, We have developed an ATL smart device project for to save the web page locally in windows mobile device. The application uses native IWebbrowser2 ATL interface control to browse the web page and save the web page complete. Now we need to have our UI and other user interface controls to be designed and developed using C# also we have some UI module already available in C#. So please provide us a method to embed native IWebbrowser2 ATL interface control to the C# smart device project. your feedback will be greatly appreciated. Thanks, Ramanand Bhat.

    Read the article

  • Disable the "Internet explorer is not currently your default browser" warning when using IWebBrowser

    - by Steven smethurst
    Hello I have a MFC application that launches a IWebBrowser2 window. On users computers where Internet Explorer is not their default browser they get the following warning message "Internet explorer is not currently your default browser. Would you like to make it your default browser?" Is there a way to disable this check before I launch a IWebBrowser2 window?

    Read the article

  • how do i login to gmail via internet explorer using iwebbrowser 2

    - by omair iqbal
    is it possible to login to sites like facebook,gmail using iwebbrowser2? in the code below what can i add so that it can login to gmail(with ie8 as browser) using the username and password i put in a variable? MyBrowser := CreateOleObject('InternetExplorer.Application') as IWebBrowser2; MyBrowser.Navigate('http://mysite.com'..........???); note : i am a newbie. sorry for my english:) and thanks in advance

    Read the article

  • not enough actual parameters ?

    - by omair iqbal
    The following program returns error : e2035 not enough actual parameters in 2 places (lines 39 and 45) and is not compiling. Can someone please help me out? Can I put 0 or null in place of parameters here? unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,ComObj,shdocvw,activex, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var mybrowser : iwebbrowser2; myUserName, myPassword,loginURL : string; Flags: OleVariant; begin Flags := navOpenInNewWindow; MyBrowser := CreateOleObject('InternetExplorer.Application') as IWebBrowser2; MyBrowser.Navigate('http://www.gmail.com',flags,'_blank'); myUserName := 'UserName'; myPassword := 'password'; loginURL:='javascript:var Email = document.getElementById(''Email'');Email.value=''' + myUserName + ''';var Password = document.getElementById(''Passwd'');Password.value=''' + myPassword + ''';var SignIn = document.getElementById(''signIn'');SignIn.click();'; MyBrowser.Navigate(loginURL); end; end.

    Read the article

  • Fork or copy a users browser session in IE

    - by jmoeller
    Is it possible to fork a users session (or do something similar) in a Internet Explorer plugin? I want to process the page the user is on when they click a button in the toolbar. To avoid interrupting the users browsing, I'd like to "copy" everything so I can parse and process the page in the background. The processing can involve things such as loading the content of the result links on a Google search, if that's where the button was clicked. So - what I basically want is to imitate "Ctrl+N" but hide the window from the user, so they won't be interrupted. As you can see, if you fill out and submit the form on http://www.snee.com/xml/crud/posttest.html and press "Ctrl+N", everything posted will still appear in the new window, but it won't post the data twice. I was thinking of somehow copying the IWebBrowser2, but: I'm not sure if that's possible (I haven't been able to find any information on MSDN) I don't know if it copies the sessions as well. Creating a new instance of the IWebBrowser2 and simply navigating to the current URL isn't a valid solution as POST-variables of course doesn't get carried over.

    Read the article

  • How to take the snapshot of a IE webpage through a BHO (C#)

    - by Kapil
    Hi, I am trying to build an IE BHO in C# for taking the snapshot of a webpage loaded in the IE browser. Here is what I'm trying to do: public class ShowToolbarBHO : BandObjectLib.IObjectWithSite { IWebBrowser2 webBrowser = null; public void SetSite (Object site) { ....... if (site != null) { ...... webBrowser = (IWebBrowser2)site; ...... } } } Also, I p/invoke the following COM methods: [Guid("0000010D-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [ComImportAttribute()] public interface IViewObject { void Draw([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, [In] IntPtr ptd, IntPtr hdcTargetDev, IntPtr hdcDraw, [MarshalAs(UnmanagedType.LPStruct)] ref COMRECT lprcBounds, [In] IntPtr lprcWBounds, IntPtr pfnContinue, int dwContinue); int GetColorSet([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, [In] IntPtr ptd, IntPtr hicTargetDev, [Out] IntPtr ppColorSet); int Freeze([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, out IntPtr pdwFreeze); int Unfreeze([MarshalAs(UnmanagedType.U4)] int dwFreeze); int SetAdvise([MarshalAs(UnmanagedType.U4)] int aspects, [MarshalAs(UnmanagedType.U4)] int advf, [MarshalAs(UnmanagedType.Interface)] IAdviseSink pAdvSink); void GetAdvise([MarshalAs(UnmanagedType.LPArray)] out int[] paspects, [MarshalAs(UnmanagedType.LPArray)] out int[] advf, [MarshalAs(UnmanagedType.LPArray)] out IAdviseSink[] pAdvSink); } [StructLayoutAttribute(LayoutKind.Sequential)] public class COMRECT { public int left; public int top; public int right; public int bottom; public COMRECT() { } public COMRECT(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } } [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [ComVisibleAttribute(true)] [GuidAttribute("0000010F-0000-0000-C000-000000000046")] [ComImportAttribute()] public interface IAdviseSink { void OnDataChange([In]IntPtr pFormatetc, [In]IntPtr pStgmed); void OnViewChange([MarshalAs(UnmanagedType.U4)] int dwAspect, [MarshalAs(UnmanagedType.I4)] int lindex); void OnRename([MarshalAs(UnmanagedType.Interface)] object pmk); void OnSave(); void OnClose(); } Now When I take the snapshot: I make a call CaptureWebScreenImage((IHTMLDocument2) webBrowser.document); public static Image CaptureWebScreenImage(IHTMLDocument2 myDoc) { int heightsize = (int)getDocumentAttribute(myDoc, "scrollHeight"); int widthsize = (int)getDocumentAttribute(myDoc, "scrollWidth"); Bitmap finalImage = new Bitmap(widthsize, heightsize); Graphics gFinal = Graphics.FromImage(finalImage); COMRECT rect = new COMRECT(); rect.left = 0; rect.top = 0; rect.right = widthsize; rect.bottom = heightsize; IntPtr hDC = gFinal.GetHdc(); IViewObject vO = myDoc as IViewObject; vO.Draw(1, -1, (IntPtr)0, (IntPtr)0, (IntPtr)0, (IntPtr)hDC, ref rect, (IntPtr)0, (IntPtr)0, 0); gFinal.ReleaseHdc(); gFinal.Dispose(); return finalImage; } I am not getting the image of the webpage. Rather I am getting an image with black background. I am not sure if this is the right way of doing it, but I found over the web that IViewObject::Draw method is used for taking the image of a webpage in IE. I was earlier doing the image capture using the Native PrintWindow() method as mentioned in the following codeproject's page - http://www.codeproject.com/KB/graphics/IECapture.aspx But the image size is humongous! I was trying to see if I can reduce the size by using other techniques. It would be great if someone can point out the mistakes (I am sure there would be many) in my code above. Thanks, Kapil

    Read the article

  • How to take the sanpshot of a IE webpage through a BHO (C#)

    - by Kapil
    Hi, I am trying to build an IE BHO in C# for taking the snapshot of a webpage loaded in the IE browser. Here is what I'm trying to do: public class ShowToolbarBHO : BandObjectLib.IObjectWithSite { IWebBrowser2 webBrowser = null; public void SetSite (Object site) { ....... if (site != null) { ...... webBrowser = (IWebBrowser2)site; ...... } } } Also, I p/invoke the following COM methods: [Guid("0000010D-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [ComImportAttribute()] public interface IViewObject { void Draw([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, [In] IntPtr ptd, IntPtr hdcTargetDev, IntPtr hdcDraw, [MarshalAs(UnmanagedType.LPStruct)] ref COMRECT lprcBounds, [In] IntPtr lprcWBounds, IntPtr pfnContinue, int dwContinue); int GetColorSet([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, [In] IntPtr ptd, IntPtr hicTargetDev, [Out] IntPtr ppColorSet); int Freeze([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, out IntPtr pdwFreeze); int Unfreeze([MarshalAs(UnmanagedType.U4)] int dwFreeze); int SetAdvise([MarshalAs(UnmanagedType.U4)] int aspects, [MarshalAs(UnmanagedType.U4)] int advf, [MarshalAs(UnmanagedType.Interface)] IAdviseSink pAdvSink); void GetAdvise([MarshalAs(UnmanagedType.LPArray)] out int[] paspects, [MarshalAs(UnmanagedType.LPArray)] out int[] advf, [MarshalAs(UnmanagedType.LPArray)] out IAdviseSink[] pAdvSink); } [StructLayoutAttribute(LayoutKind.Sequential)] public class COMRECT { public int left; public int top; public int right; public int bottom; public COMRECT() { } public COMRECT(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } } [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [ComVisibleAttribute(true)] [GuidAttribute("0000010F-0000-0000-C000-000000000046")] [ComImportAttribute()] public interface IAdviseSink { void OnDataChange([In]IntPtr pFormatetc, [In]IntPtr pStgmed); void OnViewChange([MarshalAs(UnmanagedType.U4)] int dwAspect, [MarshalAs(UnmanagedType.I4)] int lindex); void OnRename([MarshalAs(UnmanagedType.Interface)] object pmk); void OnSave(); void OnClose(); } Now When I take the snapshot: I make a call CaptureWebScreenImage((IHTMLDocument2) webBrowser.document); public static Image CaptureWebScreenImage(IHTMLDocument2 myDoc) { int heightsize = (int)getDocumentAttribute(myDoc, "scrollHeight"); int widthsize = (int)getDocumentAttribute(myDoc, "scrollWidth"); Bitmap finalImage = new Bitmap(widthsize, heightsize); Graphics gFinal = Graphics.FromImage(finalImage); COMRECT rect = new COMRECT(); rect.left = 0; rect.top = 0; rect.right = widthsize; rect.bottom = heightsize; IntPtr hDC = gFinal.GetHdc(); IViewObject vO = myDoc as IViewObject; vO.Draw(1, -1, (IntPtr)0, (IntPtr)0, (IntPtr)0, (IntPtr)hDC, ref rect, (IntPtr)0, (IntPtr)0, 0); gFinal.ReleaseHdc(); gFinal.Dispose(); return finalImage; } I am not getting the image of the webpage. Rather I am getting an image with black background. I am not sure if this is the right way of doing it, but I found over the web that IViewObject::Draw method is used for taking the image of a webpage in IE. I was earlier doing the image capture using the Native PrintWindow() method as mentioned in the following codeproject's page - http://www.codeproject.com/KB/graphics/IECapture.aspx But the image size is humongous! I was trying to see if I can reduce the size by using other techniques. It would be great if someone can point out the mistakes (I am sure there would be many) in my code above. Thanks, Kapil

    Read the article

  • How do I render the scrollable regions of a canvas with IViewObject::Draw?

    - by nirvdrum
    Hi, I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed position elements. Is this even doable? Additionally, I've tried to set the controller's size to one that would allow the entire contents to display without needing to scroll, but Windows caps the max size to the current screen resolution, so that only gets me partially there. Any help would be much appreciated. I'm currently doing this in the context of Win7 and IE8, but I don't think that should matter much.

    Read the article

  • How to attach an event to IHTMLDocument2 link elements in Delphi?

    - by Sebastian
    I'm using this code to get all the links from an IHTMLDocument2: procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant); var Document:IHTMLDocument2; Body:IHTMLElement; Links:IHTMLElementCollection; i:integer; tmp:IHTMLElement; begin try Document := (pDisp as IWebbrowser2).Document AS IHTMLDocument2; Body := Document.body; Links := Document.links; for i := 0 to (Links.length-1) do begin tmp := (Links.item(i, 0) as IHTMLElement); //tmp.onclick := HOW SHOULD I ADD THE CALLBACK HERE? //ShowMessage(tmp.innerText); end; except on E : Exception do ShowMessage(E.ClassName+' error raised, with message : '+E.Message); end; end; How could I attach a function/procedure to .onclick to do a simple task like show an alert with the anchor text when the link is clicked?

    Read the article

  • After Navigate2 Method returns S_OK Stuck at READYSTATE of READYSTATE_LOADING

    - by Stone Free
    I am working on a MFC Document View architecture application which has multiple documents and views and a tabbed window interface. I have been tasked with making an automatic switch to another tab on the press of the OK button in one of the other tabs. When the other tab is clicked on it uses a C++ wrapper over IWebBrowser2 to navigate to a specific web page. When this is done manually by clicking on the tab everything is fine and the webpage within the view loads successfully. In my first attempt at doing this the tab successfully switched in response to a call to AfxGetMainWnd()->SendMessageToDescendants(SOME_MESSAGE, ...); however by sending this windows message at the wrong point the application would crash once control returned because the chain of events caused the (modeless) dialog (*) that sent the message, to no longer exist. I then found the correct place to make the call, but now when the other tab is activated, it no longer displays the webpage as it should. To debug this problem I added code to check the READYSTATE in both the situation where it works and the situation where it does not. When the page fails to load (despite the call to Navigate2 returning S_OK), the READYSTATE just stays at READYSTATE_LOADING. Unfortunately now I am to many edits away from when I had it partially working. I have added TRACE statements to the most obvious events such as OnSetFocus, CView::OnActivateView but all traces come out in the same order despite the behaviour being different * hosted in the view

    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

  • Launch IE with specific BHO enabled

    - by watsonmw
    I have a IE BHO plugin that I only want to be enabled when the user launches IE from my program (The program start IE using CreateProcess()). I don't want this BHO to be enabled when a user launches IE from outside my program, as that would mean any problems in the BHO could potentially mess up the user's normal browsing experience. What's the best way to do this? One way would be to register the BHO, launch IE and then quickly unregister the BHO. This seems kind of messy though, as a crash in the program that launches IE could cause the BHO to remain registered.

    Read the article

  • Javascript resizing with window.open and WebBrowser control

    - by Raj
    I'm using WPF WebBrowser control and handling NewWindow3 events using following code: IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document; Guid serviceGuid = SID_SWebBrowserApp; Guid iid = typeof(SHDocVw.WebBrowser).GUID; SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref iid); wb.NewWindow3 += new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(wb_NewWindow3); How to handle javascript resizing when navigating using window.open, something like this: window.open('Sample.htm',null,'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no'); Is there anyway to get height and width requested by caller in NewWindow3 event handler?

    Read the article

  • How I can get information about the scrollbars of an Webbrowser control instance or the IE Webrowser?

    - by Salvador
    I need to get information about the scrollbars (position, size, visibility) of a Webbrowser control of an external application, I tried using the GetScrollBarInfo function from my previous question, but the function always return false, I checked this function with another applications and works fine , but not with the IE or the Webbrowser control. So how I can get information about the scrollbars of an Webbrowser control instance or the IE Webbrowser?

    Read the article

  • E_ACCESSDENIED on CoCreateInstance

    - by vucetica
    Here is a code snippet #include "stdafx.h" #include <tchar.h> #include <windows.h> #include <dshow.h> #include <ExDisp.h> int _tmain(int argc, _TCHAR* argv[]) { CoInitialize(NULL); HRESULT hr = S_OK; DWORD err = 0; // Try to create graph builder IGraphBuilder* pGraph = 0; hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&pGraph ); err = GetLastError(); // Here, hr is E_ACCESSDENIED // err is 5 (ERROR_ACCESS_DENIED) // Try to create capture graph builder (succeeds) ICaptureGraphBuilder2* pBuild = 0; hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **)&pBuild ); err = GetLastError(); // Here, hr is S_OK // err is 0 (ERROR_SUCCESS) // Try to create IWebBrowser (succeeds) IWebBrowser2* pBrowser = 0; hr = CoCreateInstance (CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, (LPVOID *)&pBrowser); err = GetLastError(); // Here, hr is S_OK // err is 0 (ERROR_SUCCESS) return 0; } I'm trying to create IFilterGraph, which fails with E_ACCESSDENIED. On the other hand, creating other directshow objects works ok. The same with some other COM objects (tried with IWebBrowser2 as an example). Any idea what can be the problem? Thanks!

    Read the article

  • IE Automation - How to Trap 'NewProcess' event

    - by dpb
    In Environment - Standard User, Win7x64, IE8 on opening Unprotected URL, IE 8 will first start a tab with low integrity and the swap out this tab with another tab of medium integrity. This is done behind the scene and the original IWebBrowser2 pointer is lost. I want to catch the 'NewProcess' Event which will get generated during this swap out, please help me how to go about this. Sample code can help me, me using C++ Ref - http://blogs.msdn.com/b/ieinternals/archive/2011/08/03/internet-explorer-automation-protected-mode-lcie-default-integrity-level-medium.aspx Thank You

    Read the article

1 2  | Next Page >