Solved

Detecting Internet Explorer Events and Reading Properties...

Posted on 2002-04-05
8
376 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
Technology Partners: 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Building cUrl in Windows v7.43.0 4 39
Cross compile release version of c++ program for linux 2 139
Socket Programming (Unix) 8 153
Precision Problem in C++ 7 51
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

726 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