Detect when a Notes Client window gets focus

Can anyone help me, I’m trying on detect when a Notes Client window gets focus. Once the window gets focus, I wish to run some code to refresh a web data feed,if the data has not been refreshed within the last 30 minutes.

We do not wish to view the web data feed directly since it will generate a lot of web traffic. The web data feed is extracted from a web URL and stored in a Notes document via a scheduled java agent every 30 minutes. It is then extracted from the Notes document and displayed on the Application Frameset.

Basically I have a page within a frameset that display data from a web URL. The data is quite dynamic so we wish refresh the display every 30 minutes. the displayed data is held in a computedText on a page within a frameset.

I have added a NotesTimer to the page with the following code to refresh the page.

    If activeWindowTitle =  "RequiredWindowTitle" Then

	Dim ws As New NotesUIWorkspace

	Call ws.ReloadWindow 

End If

I am getting the active window title via an API call.

I was intially using just ws.ReloadWindow, but this was refeshing the current window that had the focus.

The problem I know have is that the user could open the App window, intereact with it for a couple of minutes and then either work with another Notes Window or some other application.

If the NotesTimer is triggered while the User is not working with the App Window, then the App window is not refresh.

I need to implement a mechanism that forces the app window to refresh when the user returns to it, hence I was wondering how I can detect when my Application window gains focus, i.e. becomes the Active window. I can always store the last refresh time in an environment variable.

Are there any other alternative techniques I could use.

Regards Arshad