Solved

Detecting Internet Explorer Events and Reading Properties...

Posted on 2002-04-05
8
338 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
Comment Utility
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
Comment Utility
0
 
LVL 1

Author Comment

by:Aristippus
Comment Utility
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
 
LVL 1

Author Comment

by:Aristippus
Comment Utility
"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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 49

Expert Comment

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

-- Dan
0
 
LVL 1

Author Comment

by:Aristippus
Comment Utility
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
Comment Utility
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
Comment Utility
That did it...thanks, Dan

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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now