Solved

Detecting Internet Explorer Events and Reading Properties...

Posted on 2002-04-05
8
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

688 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