Discussion:
Method for Monitoring URL activity- Restart IE whenever it has not gotten a new URL every 5 mins.
(too old to reply)
Jim Mcduggan
2006-01-03 20:27:58 UTC
Permalink
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.

We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).

So are there any system calls I can do from my win32 C++ app to figure our
if IE has had http activity within 5 mins?

Thanks
Jim
Paul Baker
2006-01-03 20:51:54 UTC
Permalink
This is not an appropriate WinInet topic. WinInet is used by Internet
Explorer, but other than that, I don't see the connection.

I am not following what you are trying to do. You don't need to ever restart
Internet Explorer Why would you? FYI, Internet Explorer will restart itself
is Error Reporting is turned on and the user chooses to do so.

If you want control over your own instance of a browser, you can use a
WebBrowser control.

Paul
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure our
if IE has had http activity within 5 mins?
Thanks
Jim
Jim Mcduggan
2006-01-03 21:41:58 UTC
Permalink
The reason for posting to this group is if we have to monitor port 80 tcp
traffic to see if IE is active or stalled, that would be relevant if we
could hook into wininet.dll and see what is happening.

The system is automated, so there is no user interaction, so it won't
restart itself if the IE locks up, additionally if there server is down we
want IE to restart if it has not gotten recent data. We don't want to
create our own app, ie in kiosk mode (-k) does everything else we need.

We just want to monitor recenty activity if any and don't even have to know
what that activity was.
tx
j
Post by Paul Baker
This is not an appropriate WinInet topic. WinInet is used by Internet
Explorer, but other than that, I don't see the connection.
I am not following what you are trying to do. You don't need to ever restart
Internet Explorer Why would you? FYI, Internet Explorer will restart itself
is Error Reporting is turned on and the user chooses to do so.
If you want control over your own instance of a browser, you can use a
WebBrowser control.
Paul
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure our
if IE has had http activity within 5 mins?
Thanks
Jim
Paul Baker
2006-01-03 21:50:21 UTC
Permalink
This all sounds a little fishy. Monitoring a user application you didn't
initiate without user interaction? I don't get it. I don't want to get it ;)

Paul
Post by Jim Mcduggan
The reason for posting to this group is if we have to monitor port 80 tcp
traffic to see if IE is active or stalled, that would be relevant if we
could hook into wininet.dll and see what is happening.
The system is automated, so there is no user interaction, so it won't
restart itself if the IE locks up, additionally if there server is down we
want IE to restart if it has not gotten recent data. We don't want to
create our own app, ie in kiosk mode (-k) does everything else we need.
We just want to monitor recenty activity if any and don't even have to know
what that activity was.
tx
j
Post by Paul Baker
This is not an appropriate WinInet topic. WinInet is used by Internet
Explorer, but other than that, I don't see the connection.
I am not following what you are trying to do. You don't need to ever
restart
Post by Paul Baker
Internet Explorer Why would you? FYI, Internet Explorer will restart
itself
Post by Paul Baker
is Error Reporting is turned on and the user chooses to do so.
If you want control over your own instance of a browser, you can use a
WebBrowser control.
Paul
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure
our
Post by Paul Baker
Post by Jim Mcduggan
if IE has had http activity within 5 mins?
Thanks
Jim
Jim Mcduggan
2006-01-04 00:28:21 UTC
Permalink
It's called a Public Kiosk we own! Understand now Paul!
Newsgroup rule #1: if you don't have something helpful to say, keep it to
yourself.
Post by Paul Baker
This all sounds a little fishy. Monitoring a user application you didn't
initiate without user interaction? I don't get it. I don't want to get it ;)
Paul
Post by Jim Mcduggan
The reason for posting to this group is if we have to monitor port 80 tcp
traffic to see if IE is active or stalled, that would be relevant if we
could hook into wininet.dll and see what is happening.
The system is automated, so there is no user interaction, so it won't
restart itself if the IE locks up, additionally if there server is down we
want IE to restart if it has not gotten recent data. We don't want to
create our own app, ie in kiosk mode (-k) does everything else we need.
We just want to monitor recenty activity if any and don't even have to know
what that activity was.
tx
j
Post by Paul Baker
This is not an appropriate WinInet topic. WinInet is used by Internet
Explorer, but other than that, I don't see the connection.
I am not following what you are trying to do. You don't need to ever
restart
Post by Paul Baker
Internet Explorer Why would you? FYI, Internet Explorer will restart
itself
Post by Paul Baker
is Error Reporting is turned on and the user chooses to do so.
If you want control over your own instance of a browser, you can use a
WebBrowser control.
Paul
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL
every
Post by Paul Baker
Post by Jim Mcduggan
Post by Paul Baker
Post by Jim Mcduggan
5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure
our
Post by Paul Baker
Post by Jim Mcduggan
if IE has had http activity within 5 mins?
Thanks
Jim
Paul Baker
2006-01-04 15:20:46 UTC
Permalink
Sorry, you're right to say that's a good newsgroup rule :)

The trouble is what you are saying is quite vague. From what you say, it
sounds like you want a lot of control over the browser and if it is a public
kiosk, I can see why.

So, why don't you just use a WebBrowser control? This makes the browser
yours, therefore you have more control over it. As I understand it, this is
the usual way of implementing such an application. In fact this is what we
have at all the libraries in our county.

Paul
Post by Jim Mcduggan
It's called a Public Kiosk we own! Understand now Paul!
Newsgroup rule #1: if you don't have something helpful to say, keep it to
yourself.
Post by Paul Baker
This all sounds a little fishy. Monitoring a user application you didn't
initiate without user interaction? I don't get it. I don't want to get it
;)
Post by Paul Baker
Paul
Post by Jim Mcduggan
The reason for posting to this group is if we have to monitor port 80
tcp
Post by Paul Baker
Post by Jim Mcduggan
traffic to see if IE is active or stalled, that would be relevant if we
could hook into wininet.dll and see what is happening.
The system is automated, so there is no user interaction, so it won't
restart itself if the IE locks up, additionally if there server is down
we
Post by Paul Baker
Post by Jim Mcduggan
want IE to restart if it has not gotten recent data. We don't want to
create our own app, ie in kiosk mode (-k) does everything else we need.
We just want to monitor recenty activity if any and don't even have to know
what that activity was.
tx
j
Post by Paul Baker
This is not an appropriate WinInet topic. WinInet is used by Internet
Explorer, but other than that, I don't see the connection.
I am not following what you are trying to do. You don't need to ever
restart
Post by Paul Baker
Internet Explorer Why would you? FYI, Internet Explorer will restart
itself
Post by Paul Baker
is Error Reporting is turned on and the user chooses to do so.
If you want control over your own instance of a browser, you can use a
WebBrowser control.
Paul
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL
every
Post by Paul Baker
Post by Jim Mcduggan
Post by Paul Baker
Post by Jim Mcduggan
5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to
figure
Post by Paul Baker
Post by Jim Mcduggan
our
Post by Paul Baker
Post by Jim Mcduggan
if IE has had http activity within 5 mins?
Thanks
Jim
Scherbina Vladimir
2006-01-04 09:36:17 UTC
Permalink
Writing BHO allows you to control all IE events. You can react on
BeforeNavigate, DocumentComplete, NavigateError and other events, make "time
estimations" and call *->Quit() if necessary.

The simplest solution for you is to save time to some variable in
DocumentComplete/BeforeNavigate handler, start some thread that calculates
how much time've passed since last DocumentComplete/BeforeNavigate was
invoked and close browser if that value is greater then 5 minutes.

BTW, this is not good idea - to close browser after some inactivity,
because user might change his local time and all his opened pages will
disappear...Maybe you should change your approach to the problem ?

--
Vladimir
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure our
if IE has had http activity within 5 mins?
Thanks
Jim
Jim Mcduggan
2006-01-04 19:01:07 UTC
Permalink
Good suggestion Vladimir.
The machine is a Kiosk, so we are not worried about the time changing.
Can we write a BHO inside our c++ .exe daemon application or does it have to
be it's own file/application?
Is there any other way than a BHO, maybe even at the winsock layer?
Post by Scherbina Vladimir
Writing BHO allows you to control all IE events. You can react on
BeforeNavigate, DocumentComplete, NavigateError and other events, make "time
estimations" and call *->Quit() if necessary.
The simplest solution for you is to save time to some variable in
DocumentComplete/BeforeNavigate handler, start some thread that calculates
how much time've passed since last DocumentComplete/BeforeNavigate was
invoked and close browser if that value is greater then 5 minutes.
BTW, this is not good idea - to close browser after some inactivity,
because user might change his local time and all his opened pages will
disappear...Maybe you should change your approach to the problem ?
--
Vladimir
Post by Jim Mcduggan
We have a C++ app that restarts IE if it dies, but we want to add 1 more
function and wonder the best way, if even possible to do it.
We would like to restart IE whenever it has not gotten a new URL every 5
mins. ( our screensaver page does a 3 min refresh, so if it has not
refreshed that url then either the net is down or IE is frozen).
So are there any system calls I can do from my win32 C++ app to figure our
if IE has had http activity within 5 mins?
Thanks
Jim
Scherbina Vladimir
2006-01-04 19:17:13 UTC
Permalink
Post by Jim Mcduggan
Good suggestion Vladimir.
The machine is a Kiosk, so we are not worried about the time changing.
Can we write a BHO inside our c++ .exe daemon application or does it have to
be it's own file/application?
Is there any other way than a BHO, maybe even at the winsock layer?
Sorry, I know nothing about Kiosk (btw, in russian it has interesting
meaning, not connected with computers at all :) ), but you may implement BHO
(its inproc COM component that is represented as DLL) that will be
communicating with your *.exe application (if necessary) using IPC.

Note, that this is win32 specific techinque. For more information read this
article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/bho.asp
(Browser Helper Objects: The Browser the Way You Want It).

As for another ways: there is no another documented way to detect that
browser is idle. Sure, you may write driver (or LSP, etc) that intercepts
network packets, or hook windows messages, or enumerate ShellWindows items,
retrieving items path, and then make comparisons whenether it changed for
last 5 minutes, etc... but all those approaches are overheat.
--
Vladimir
Loading...