Solved

Detecting Internet Explorer Events and Reading Properties...

Posted on 2002-04-05
8
367 Views
Last Modified: 2007-12-19
Using Visual C++, I need help simply detecting a few IE events (NewWindow2, BeforeNavigate2, OnVisible), retrieving a few property values (LocationURL, etc) and calling a couple of methods (Navigate2, Refresh2, Stop, Quit).

I am very familiar with VB and OnEvents, however have no idea how to capture this info in VC++.

I am not looking to include a browser within my app, but retrieve the above info on any instance of IE running on the machine.

I am willing to allocate many more points for an actual VC++ project created that will simply do the above (maybe a messagebox on the events) and emailed to the email account I created just for this: Adrenaline__X@hotmail.com
(Note that there are two underscores in the email addy)

Thanks in advance for the assistance.
Aristippus
0
Comment
Question by:Aristippus
  • 4
  • 4
8 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 6920425
It is spelled out here, including plenty of sample code!

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q176792

-- Dan
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 300 total points
ID: 6920428
0
 
LVL 1

Author Comment

by:Aristippus
ID: 6921744
DanRollins,

Your first link is one that I have already tried, and it does allow me to "Connect to a Running Instance of Internet Explorer (Q176792)" just as it states. And I can also detect WindowRegistered and WindowRevoked events, but not the events that I wanted (NewWindow2, BeforeNavigate2, etc.)

The second link appear entirely viable (except I was hoping to not have to create the app as a dll and register it) but my VC++ are lacking and I can't get a functional sample from the code given.

Again, if someone were willing to create a working project and email it to the addy above I would be willing to increase the points substantially.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:Aristippus
ID: 6921754
"Again, if someone were willing to create a working project and email it to the addy above I would be
willing to increase the points substantially. "
Sorry, I meant a non-BHO/dll working project...not just emailing the code that is given in the above link =)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6921900
For a non-DLL solution, I'll chip in a few points too.

-- Dan
0
 
LVL 1

Author Comment

by:Aristippus
ID: 6921911
Ok, I see that I bit off more than I can chew here...

Dan,
Your second link (the BHO solution) will probably be my best bet, but I can't even compile the code that is provided in the link...

I am running VC++ 6 and the project is converted from the older version as I open it and I receive the following errors when attempting to compile:

Compiling...
EventsDlg.cpp
E:\SSleuth CPP\BHO\EventsDlg.cpp(44) : error C2664: 'unsigned int __thiscall ATL::CWindow::GetDlgItemTextW(int,unsigned short *,int) const' : cannot convert parameter 2 from 'char [260]' to 'unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
E:\SSleuth CPP\BHO\EventsDlg.cpp(46) : error C2664: 'Navigate' : cannot convert parameter 1 from 'char [260]' to 'unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
E:\SSleuth CPP\BHO\EventsDlg.cpp(63) : error C2664: 'GetTextExtentPoint32W' : cannot convert parameter 2 from 'const char *' to 'const unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
IEHelper.cpp
IEHlprObj.cpp
E:\SSleuth CPP\BHO\IEHlprObj.cpp(176) : error C2664: 'strcmp' : cannot convert parameter 1 from 'unsigned short *' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Generating Code...
Error executing cl.exe.

IEHelper.dll - 4 error(s), 0 warning(s)

Help me iron out these to produce a working copy of this example and the points (along with more) are yours...
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6921938
Those errors look to be related to the use of UNICODE.  For instance, GetDlgItemTextW() is aclling the 'Wide' version of the fn.  And strcmp is looking for 'unsigned short' which is an alias for UNICODE character data type.

Check the project settings aand turn off the use of UNICODE then clean and rebuild.

-- Dan
0
 
LVL 1

Author Comment

by:Aristippus
ID: 6921966
That did it...thanks, Dan

Here are the points and as promised I am creating another question with more for ya.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question