473,626 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebBrowser BeforeNavigate2 - What is pDisp?

Hi all,

I'm using SHDocVw to hook directly into IE. Anyone know what pDisp stands
for?

BeforeNavigate2 (ByVal pDisp As Object, ByRef URL As Object, ByRef Flags As
Object, ByRef TargetFrameName As Object, ByRef PostData As Object, ByRef
Headers As Object, ByRef Cancel As Boolean)

Is the pDisp a pointer to the sender?

I'm keeping a list of WebBrower objects in an array - is there a way to use
the pDisp to find the sender of the event?

Thanks.
Dec 10 '06 #1
3 8634
Spam Catcher <sp**********@r ogers.comwrote:
>Is the pDisp a pointer to the sender?
I'm keeping a list of WebBrower objects in an array - is there a way to use
the pDisp to find the sender of the event?
As per MSDN, pDisp is "Pointer to the IDispatch interface for the
WebBrowser object that represents the window or frame. This interface
can be queried for the IWebBrowser2 interface."

So yes, pDisp points to the IDispatch interface of the sender. And
from it you can QueryInterface to find the IWebBrowser2 of the sender.
Or to find its IUnknown identity.

--
Lucian
Dec 10 '06 #2
Lucian Wischik <lu***@wischik. comwrote in
news:if******** *************** *********@4ax.c om:
Spam Catcher <sp**********@r ogers.comwrote:
>>Is the pDisp a pointer to the sender?
I'm keeping a list of WebBrower objects in an array - is there a way
to use the pDisp to find the sender of the event?

As per MSDN, pDisp is "Pointer to the IDispatch interface for the
WebBrowser object that represents the window or frame. This interface
can be queried for the IWebBrowser2 interface."

So yes, pDisp points to the IDispatch interface of the sender. And
from it you can QueryInterface to find the IWebBrowser2 of the sender.
Or to find its IUnknown identity.

Thanks Lucian,

I'm not too familiar working with non-managed objects ... do you have any
examples on how to query for the interface in VB.NET?

Thanks.
Dec 10 '06 #3
Spam Catcher <sp**********@r ogers.comwrote in
news:Xn******** *************** ***********@127 .0.0.1:
Thanks Lucian,

I'm not too familiar working with non-managed objects ... do you have
any examples on how to query for the interface in VB.NET?

Thanks.
I found an easier method of checking the status of my browser Windows.

I scan all my active Windows and compare the HWND to the handlers in BHO's
ShellWindows.

From there, I can retrieve the InternetExplore r object and get all the
details I need about the browser.

This seems more reliable than using the BHO's events... as it seems BHO's
events don't fire consistently (there seems to be some MSDN articles
documenting this).
Dec 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
21295
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until WebBrowser.ReadyState = STATE_COMPLETE (or something like that. I don't have the code in front of me) But, for some reason, occasionally the code continues past the loops even
3
1629
by: Jim Hubbard | last post by:
According to Visual Studio 2003 Help files "In Internet Explorer 6 or later, the BeforeNavigate2 event fires only before the first navigation made in code. It does not fire when a user clicks a link on a Web page." If I want to intercept each webpage before it is rendered in the webbrowser control (to add or remove code), where would I do so in the webbrowser control? Any suggestions?
0
1690
by: Carl Manson | last post by:
Hi All, I am writing a complex print job solution that requires the printing of many HTML documents in an exactly defined order. Our application uses the IE WebBrowser control to render the documents, then fire them off to the printer. It is all fully automated, so no user interaction is required. However, some documents are larger than others and take longer to spool. The standard behaviour of spoolers/print queues is FIFO, but
2
4940
by: Mitch | last post by:
I ahve a windowsform app with an embedded web browser. I let VS create a wrapper called AxWebBrowser. The "BeforeNavigate2" event handler fires as expected, unitl I also add a handler to the "onclick" event that is part of the mshtml.HTMLDocumentEvent2 object. In addition when I add the "onclick" event handler, the browser looses all ability to navigate. i.e. clicking a link does nothing, no events raised, no navigating to the link url. ...
3
1575
by: Newton Godoy | last post by:
Hi all, I'm having some dificulties in using the webbrowser events in a windows forms. Events like downloadcomplete, navigatecomplete etc seem not be raised at all. For testing, I have placed a breakpoint inside the handler for those events but the program never stops there. Are there known issues with using webbrowser's events? The only thing I am able to do at the moment is to use the navigate method to display content in the...
9
3172
by: philip | last post by:
Is it possible, on a WebBrowser control, to intercept a HyperLink and react programmatically to this click ? That's my first question. In fact, I use the Webbrowser as a sort of report (I write the html code and tables programmatically in a string, and I give the string to the property DocumentText of the WebBrowser, and I insert in this code some Hyperlinks by wich I could react, launching an specific action) The properties...
0
4880
by: bacsumu | last post by:
In my c# program ive got a WebBrowser control in which a certain website is called. This website gives for some reason a javascript errors (message box) from time to time. Is there a way to build my program so that the javascript errors dont appear ? i search many article but i don't solve i'm try next
0
2137
by: Jocker | last post by:
Hi Group I'm writing an Internet Explorer plugin. Everything works well, except when I try to handle the onscroll event. http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/window2/onscroll.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onscroll.asp another possibility seems to exist with IHTMLElement2.onscroll using the document body, but this does not solve the problem. the following code snippet...
5
6570
by: mabond | last post by:
Hi recently read a posting and reply about Excel processs still running after the Appliction.Quit was called. Thought I might be able to use the same (System.Runtime.InteropServices.Marshal.ReleaseComObject(exApplication)) to solve my problem but could not. Background : My app uses a WebBrowser control to display to the user the contents of an Excel spreadsheet.:
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.