Click here to Skip to main content
13,088,734 members (51,835 online)
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 6 Jan 2000

Selective Offline Browser

, 6 Jan 2000
Rate this:
Please Sign up or sign in to vote.
An useful application to download only selected files for offline browsing.

Sample Image - OfflineBrowser.jpg

While browsing a message board a few days back, I noticed that someone wanted a utility to download only selected files for offline browsing. Seemed to me like an useful tool to have, so I wrote one.

While IE does let you download files for offline browsing, you have no control over which files are downloaded, you may just want a few, not all of the pages. This utility will give you that control.

To run this application, you will require IE 4.01 or above, as it is based on the WebBroswer2 control provided by IE. What the app does is pretty simple. You can specify a list of file specifications (*.html, r*.htm, etc...) and then choose a start page to start downloading from. Also you can specify the number of levels you want to download. The default is 0, which is rather useless. So for e.g., if you ask for 2 levels - all links which match the specifications you have entered will be followed down to 2 levels.

The application by itself is based on a CHTMLView which creates an IE WebBrowserApp control and runs it. All I really have done is create a class CHTTPLineHolder which takes a LPDISPATCH (interface to a WebBrowserApp) and uses it to download pages into your local system cache.

So, the basic logic followed is as follows:

NavigateToPage - ( URL to navigate to )
    Store Page Into Cache

    For Each Link which satisfies  File Spec given 
        NavigateToPage ( Current Link)


This by itself will download the file - but to store it, a couple of calls to the WinInet library have to be made. These calls get a cache file name and store the page into the file. As this file name is got through WinInet, any application (including IE) which uses WinInet can use this cache.

Also, the whole operation is done on a separate thread, so as to allow painting by the main view. So as each page is got, you get to see it in the main view window.

The methods which do the work are:

CHTTPLinkHolder::ReadPage(const CString& szUrl)


CHTTPLinkHolder::ReadPageIntoCache(const CString& szURL)

To use the application, first choose View | File Extensions.. and add or delete items from the list until you have only the specs you need. You can use wildcards here so, "*.htm", "a*b?c.htm" etc. are valid specs. Next, choose View | Start... You will be asked for a starting page and the number of levels to download, enter this info and click OK. And once this process is over, go to IE, make sure your Offline Browsing option is set and choose the same start page you entered in the application. And you should be able to view the files you downloaded. Exceptions of course are dynamic content files which may not be downloaded as expected.

So - Happy Offline Browsing.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Rajiv Ramachandran
Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralUsing a proxy Pin
www.add-your-page.com28-Jun-06 22:35
memberwww.add-your-page.com28-Jun-06 22:35 
QuestionEnable ActiveX execution? Pin
dragomir11-Sep-04 7:42
memberdragomir11-Sep-04 7:42 
GeneralCHtmlView and Swing Pin
Sky17-Jul-02 22:43
memberSky17-Jul-02 22:43 
Generalwe could not save anything... Pin
Anonymous26-Jun-01 3:34
memberAnonymous26-Jun-01 3:34 
GeneralBrowser Helper Objects Pin
rajeshmatch1-Apr-01 22:45
memberrajeshmatch1-Apr-01 22:45 
GeneralRe: Browser Helper Objects Pin
Wenstone10-Jul-01 22:55
memberWenstone10-Jul-01 22:55 
GeneralGreat selection of webpage to show Pin
ron20-Mar-00 3:41
sussron20-Mar-00 3:41 
GeneralRe: Great selection of webpage to show Pin
Anonymous24-Apr-01 8:59
memberAnonymous24-Apr-01 8:59 
GeneralRe: Great selection of webpage to show Pin
Nas29-Nov-01 10:08
memberNas29-Nov-01 10:08 
GeneralFix For Not being able to build project Pin
Rajiv Ramachandran28-Jan-00 12:16
sussRajiv Ramachandran28-Jan-00 12:16 
GeneralMessage Closed Pin
12-Jan-00 5:53
sussGlenn Swonk12-Jan-00 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170813.1 | Last Updated 7 Jan 2000
Article Copyright 2000 by Rajiv Ramachandran
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid