Asp refresh page

Asp refresh page

ASP Programe About Us Links Downloads Contact Us Terms of use SiteMap
Asp refresh page
Asp refresh page

 

You are here: ASP Programe >>Asp refresh page

Asp refresh page article lists.

Asp refresh page

No More Clicking "Refresh"




Do you find yourself clicking the Refresh button in your Web browser frequently to check for updated information on sites? Perhaps you are tracking stock prices, looking at sports scores, reading messages on a Web-based discussion group, or watching an auction to see if the high bid changes. If there's nothing new, you will have refreshed unnecessarily. But if you wait too long, you won't see the new information right away. Worse, new data may replace the data you want before you've seen it.

With BrowseFresh, this issue's utility, your browser is refreshed automatically if and when needed. Options let you control how frequently to check for updates, and whether refreshed browser windows are activated.

BrowseFresh runs under Windows 95, Windows 98, Windows Me, Windows NT 4.0, and Windows 2000 and requires Internet Explorer 4.0 or greater. The Microsoft C++ source code for BrowseFresh is provided with the utility for those interested in seeing how it works. Note that PC Magazine programs are copyrighted and cannot be distributed, whether modified or unmodified. Use is subject to the terms and conditions of the license agreement distributed with the programs.

Using BrowseFresh

To install BrowseFresh, run the installation program Setup.exe. This will prompt you for an installation path and then copy the files to your hard drive. To uninstall BrowseFresh, use the Add/Remove Programs applet in Control Panel.

When you first run BrowseFresh, you will see a window with a list of the currently open IE windows (see Figure 1). If there are no current IE browsers active, the list will be empty. Browser windows are be added to the list when they're opened. Each browser window entry has a check box to the left of the page title and URL. Select the check box if you want BrowseFresh to automatically update the content in that window. Browser windows start off marked with an IE document icon. When a page has been updated, the icon changes to a small, pink flower and the last update time is noted.

BrowseFresh is a tray application. When the program is idle, the tray icon is the small, pink flower shown in Figure 2. When BrowseFresh is checking for new page data, the icon changes to the animated, revolving arrows shown in Figure 3. If a Web page's data cannot be downloaded-for example, if there is a problem with the URL or the Internet connection-the icon next to that window's entry in the browser list will be an exclamation point (see Figure 4). BrowseFresh ignores file: and about: URLs but will attempt to obtain update information for any other type.

There are some types of changes in a Web page that BrowseFresh is unable to track-image files, Java applets and changed Flash animations, for instance. BrowseFresh tracks the main page information, whether the format is HTML, ASP, CGI, JSP or some other text format. The program also takes tags into account and tracks the frames in the main page, but not frames within frames.

BrowseFresh Options

When you click on the Options button, you will see the dialog box shown in Figure 5. The first option is a check box labeled Activate browser window on refresh. This option will attempt to activate any browser window upon updating. In earlier versions of Windows the browser window will actually be brought to the front. In later versions, the taskbar button associated with the browser window will flash, to let you know there is new data. Check the Keep BrowseFresh window on top of other windows option to keep the BrowseFresh window in the foreground at all times. This is useful when you want to watch the browser window and the BrowseFresh window simultaneously.

Because all browser windows are unchecked by default, you may want to check the option Show browser list when BrowseFresh starts. This will cause BrowseFresh, when launched, to display the browser list, so you can check the windows you want to track.

You can also tell BrowseFresh how often to check for new content. The interval can be in seconds or minutes, depending on how often the information is updated or how often you need to see updated information. Note that this is the interval between the end of the previous check and the beginning of the next one, but you must add any time needed to download new data. Suppose you have a 30-second interval, and BrowseFresh always takes 45 seconds to perform the check and get the new data. The interval from the start of one check to the start of the next would be 75 seconds.

Inside BrowseFresh

The first decision I had to make when writing BrowseFresh was whether to make the application a Browser Helper Object (BHO) or a standalone program. I chose to write a standalone program, because a BHO affects all Internet Explorer instances. A standalone program can control which instances are to be tracked. Also, with a BHO, I'd have to create a separate program to handle the interface and user settings. The standalone approach is more straightforward.

Once I decided not to use a BHO, I had to figure out how to enumerate all instances of Internet Explorer. I started by using the Spy++ utility that comes with Microsoft Visual Studio. This showed me that each IE browser window was an instance of the class IEFrame. Knowing this, I was able to use the application's window handle to track each running instance of IE.

Knowing the handle was not enough, though. There is no call that can get URL and title information using the window handle, so I went to programming newsgroups and also searched MSDN (Microsoft Developer Network, http://msdn.microsoft.com). I learned that Internet Explorer is an extension of the shell windows in the Windows Explorer interface (which also controls desktop windows and folder objects), and I had to use the ShellWindows COM object to access IE. BrowseFresh works only with the Microsoft browser, because IE provides COM objects for integration and other browsers do not.

When first starting, BrowseFresh creates an interface pointer to ShellWindows called IShellWindowsPtr. It then uses this pointer to enumerate all instances of Internet Explorer. The interfaces to this object are not well documented, so I developed much of the code in BrowseFresh through trial and error, using some references from MSDN.

In my first attempts at coding this, not only did IE browser windows show up, but every open folder and instance of Windows Explorer did, too. To show IE instances only, the program obtains a pointer to the IHTMLDocument2Ptr object for each Shell window's document. This points to the document inside the browser and gives access to the URL and title. The return of a non-NULL value indicates that the window displays a Web page.

The second challenge in writing BrowseFresh was to track changes in the currently viewed pages. BrowseFresh must keep track of the HTML on each currently viewed page. Further, when a page is updated, the program must know to track the new page. BrowseFresh must also be smart enough not to refresh a browser that is already in the process of refreshing.

To perform the tracking, BrowseFresh uses the Win32 Internet functions to request data from a browser's current URL. The request is made through a worker thread to prevent the user interface from freezing until the request returns. After the worker thread begins, BrowseFresh continues to track and monitor IE instances through the main application's thread. When the asynchronous data request is finished (or receives an error), the worker thread posts a message back to the BrowseFresh window before terminating. On receipt of this information, BrowseFresh processes the data accordingly and can track whether a browser's page content has changed. If the page has changed, the program calls the IWebBrowser2::Refresh() method to refresh the browser.

Communicating with IE

COM technology is the standard method for communication in 32-bit Windows. BrowseFresh relies on COM to communicate with existing Internet Explorer instances and to determine page information and status. BrowseFresh creates an instance of ShellWindows in the constructor for the CBrowserRefreshDlg object, which is used to enumerate all running instances of Internet Explorer. If this call fails, then BrowseFresh is unable to communicate with the shell windows object and the program terminates with an error message.

Asp refresh page Related Links
Active server pages error asp 01310113 active asp error page server
How to debug asp pagesAsp web page
Asp login pageActive server pages error asp 0126
Asp home pageAsp web pages default permission
Asp redirect pagePage break asp
Flip image asp web pageCreate asp pages
How to password protect your asp pagesPersistent and asp and .net and datagrid
Datatable and session and asp and .net.net asp datatable state store
Asp .net trainingAsp .net report
Use asp htmlAsp web portal
Excel reporting aspAsp excel export
Apache web server and aspApache server asp
Web service mnl ust ph ustet 2004 login aspUltimate movie download memarea login asp
Web detective member login aspGsis.gov.ph e gsis login asp
3bsoftwaredownloads1 login aspMycampus phoenix login asp
Asp login cookie remember meAsp login example
Epcra state.mn.us turnaround login aspAsp login cookie
Pmcma ontrac login aspHttp messenger.msn.nl friend default asp
Htv truyenhinh default aspV4 windowsupdate.microsoft.com en default asp
Protected media license delivered default aspAsp chart component
Asp zip componentProduction fax asp
Web fax aspDate format in asp
Asp date functionAsp string function
Asp call functionAsp time function
Asp replace functionAsp split function
 
©2005 All Rights Reserved   ASP Programe