|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 "Jim Mcduggan" <spam@spammer.com> wrote in message news:%23zHS2PKEGHA.2320@TK2MSFTNGP11.phx.gbl... > 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 > > |
|
#3
|
|||
|
|||
|
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? "Scherbina Vladimir" <vladimir.scherbina@gmail.com> wrote in message news:%239ZL4JREGHA.3052@TK2MSFTNGP10.phx.gbl... > 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 > > "Jim Mcduggan" <spam@spammer.com> wrote in message > news:%23zHS2PKEGHA.2320@TK2MSFTNGP11.phx.gbl... > > 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 > > > > > > |
|
#4
|
|||
|
|||
|
"Jim Mcduggan" <spam@spammer.com> wrote in message
news:%23k4d%23DWEGHA.1384@TK2MSFTNGP11.phx.gbl... > 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/de...n/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 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|