Click here to Skip to main content
15,888,242 members
Articles / Web Development / HTML
Article

SurfHelper: A popup window killer and history cleaner

Rate me:
Please Sign up or sign in to vote.
4.77/5 (13 votes)
15 Nov 2001 190.2K   3.7K   46   32
A free tool to remove popup windows, clear history, control window properties of IE, and more.

Introduction

This free tool was written to make surfing more comfortable and efficient.

Features

  • Remove popup windows by URL, title or window size.
  • Clear internet URL history, typed URL, temporary internet files, internet cookies, autocomplete forms history, autocomplete passwords history, Internet Explorer favorites, temp files, run history, document history, last logon user, find files history, find computer history, network connection history and telnet history.
  • Let IE window always show tool bar, menu bar, address bar, status bar and always resizable.
  • Hide IE windows by hotkey.
  • Remove status bar modifiers, context menu disablers, "onunload" command, Flash, and timer. (not 100% worked)

Requirements

  • The main program uses WTL 3.1. It was compiled and tested using Visual Studio 6.0, on Windows 2000.

Thanks to:

  • Peter Sun - Delete Temporary Internet Files
  • Ralph Walden - Case-Insensitive String Search
  • Magnus Egelberg - Dlg item resizer

License

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


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralUnable to download the file Pin
saravananvv4-May-05 6:23
saravananvv4-May-05 6:23 
GeneralProblems Pin
Gianfranco Savino31-Aug-04 12:35
Gianfranco Savino31-Aug-04 12:35 
QuestionHow to query a specific url from IE History? Pin
musicway1-Mar-04 19:36
musicway1-Mar-04 19:36 
GeneralRun history problems in XP... Pin
marcosvelasco14-Oct-03 6:32
marcosvelasco14-Oct-03 6:32 
GeneralRe: Run history problems in XP... Pin
Archit93732844484-Jan-09 3:15
Archit93732844484-Jan-09 3:15 
GeneralRun history problems in XP... Pin
marcosvelasco14-Oct-03 6:32
marcosvelasco14-Oct-03 6:32 
GeneralRe: Run history problems in XP... Pin
Anonymous2-Apr-04 3:41
Anonymous2-Apr-04 3:41 
QuestionHow to find specific file in Temporary Internet Files? Pin
Stuard20-Sep-02 7:52
Stuard20-Sep-02 7:52 
AnswerRe: How to find specific file in Temporary Internet Files? Pin
Hirosh Joseph11-Mar-03 21:33
Hirosh Joseph11-Mar-03 21:33 
GeneralForms Autocomplete Pin
Wayland Young23-May-02 2:27
professionalWayland Young23-May-02 2:27 
GeneralRe: Forms Autocomplete Pin
25-May-02 23:43
suss25-May-02 23:43 
GeneralRe: Forms Autocomplete Pin
Wayland Young26-May-02 5:13
professionalWayland Young26-May-02 5:13 
GeneralPossibly better way to kill popup windows Pin
Christian Andritzky3-Mar-02 11:10
Christian Andritzky3-Mar-02 11:10 
GeneralRe: Possibly better way to kill popup windows Pin
Martijn10-Feb-03 23:06
Martijn10-Feb-03 23:06 
GeneralSame to me I want to write Popup add killer Like "Popup Ad filter" which auto kill popads but none of usefull links Pin
Ibrar Ahmad11-Jan-02 6:10
Ibrar Ahmad11-Jan-02 6:10 
GeneralPopup window Pin
Ralfy16-Dec-01 22:14
Ralfy16-Dec-01 22:14 
GeneralRe: Popup window Pin
Ibrar Ahmad11-Jan-02 6:09
Ibrar Ahmad11-Jan-02 6:09 
GeneralRe: Popup window Pin
Ralfy9-Feb-03 2:49
Ralfy9-Feb-03 2:49 
GeneralSerious Design & Coding Problems Pin
Bill SerGio24-Nov-01 0:36
Bill SerGio24-Nov-01 0:36 
First, let me say that you did an excellent job and wrote a lot of excellent code. The readers of this site should be very grateful that you posted this code because it does contain a lot of good samples on how to code certain things.

Unfortunately, your code has a number of serious Design & Coding Problems. I have written a LOT of programs like this one for many companies and your approach to the design of the application is very bad for use as a REAL application in the REAL world for several reasons as follows:

1) You are NOT using Browser Helper Objects correctly. BHOs fail very often when their are more than one BHO listed in the registry and this varies as a function of the version of IE installed. The CORRECT way to use BHO is to create a list of existing BHOs and determine if your GUID will sort above them alphabetically---if not, you must create a new GUID for your BHO that starts with something like {0000001..... so it will appear at the TOP of the list of BHOs--BHO are loaded alphabetically in sequence. And the commercial applications I write remove all the other BHO until my DLL has load and THEN I restore the other GUIDs back to the registry--this is what professional application programmers do.

2) NEVER use the BHO to do anything except to launch another program or toolbar and then exit IMMEDIATELY! The BHO itself should NEVER be used as part of the application because it creates a lot of coding problems and SLOWS the performance of any sink application!
****For example, consider to problem of launching a NEW instance of IE from within your application. If you do this, you will notice that you are in a vicious loop that is a diaster for the user:

LRESULT OnPopupSoftware(WORD /*wNotifyCode*/,WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
BSTR bsURL;
bsURL = SysAllocString(OLESTR("http://www.codeproject.com"));
LauchIEBrowser(bsURL);
SysFreeString(bsURL);
return 0;
}

/////////// CAUSES VICIOUS LOOP!!! ///////////
void LauchIEBrowser(BSTR bstrURL)
{
// Instantiate a browser
IWebBrowser2* pWebBrowser = NULL;
HRESULT hr = NULL;
VARIANT vtEmpty;
vtEmpty.vt = VT_EMPTY;
VARIANT vtURL;
vtURL.vt = VT_BSTR;
vtURL.bstrVal = bstrURL;

if (FAILED(hr = CoInitialize(NULL))) {
return;
}

if (FAILED(hr = CoCreateInstance(CLSID_InternetExplorer,
NULL, CLSCTX_SERVER, IID_IWebBrowser2, (LPVOID*)&pWebBrowser))) {
goto Error;
}

try {
// Make it visible
if (pWebBrowser != NULL) {
hr = pWebBrowser->put_Visible(VARIANT_TRUE);
hr = pWebBrowser->Navigate2(&vtURL, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);

HWND hwnd = NULL;
pWebBrowser->get_HWND((long *) &hwnd);

if ( hwnd != NULL ) {
//::SetForegroundWindow(hwnd);
::ShowWindow(hwnd, SW_SHOWMAXIMIZED);
}
////////////////////////// CORRECT WAY TO SHOW BAND ///////////////////////
// AUTHOR: BILL SERGIO
// NOTE: MSDN gives an INCORRECT example of how to do this!
// You MUST pass "&vtEmpty" and NOT "0" as last parameter!
//
// Display Explorer ToolBar
VARIANT vtBandGUID, vtShow;
vtBandGUID.vt = VT_BSTR;
vtBandGUID.bstrVal = SysAllocString(OLESTR("{5D570CA3-3123-11D5-B8D0-D2E7CAE90E45}"));
vtShow.vt = VT_BOOL;
vtShow.boolVal = true;
// You MUST pass "&vtEmpty" and NOT "0" as last parameter!
pWebBrowser->ShowBrowserBar(&vtBandGUID, &vtShow, &vtEmpty);
SysFreeString(vtBandGUID.bstrVal);
///pWebBrowser->Release();
/////////////////////////////////////////////////////////////////////////////
}
}
catch(...){goto Error;}
SysFreeString(vtURL.bstrVal);

Error:
// Clean up
VariantClear(&vtURL);
SysFreeString(vtURL.bstrVal);

if (pWebBrowser) {
pWebBrowser->Release();
}

return;
}
//////////////////////////

When you launch the new IE window it calls the BHO which calls your program, etc....... This code would work fine if you only used the BHO to launch your application but it results in a deadly loop that the user can't exit from in your application. So to make the simple act of opening a new browser window and loading a toolbar in your program work you would need a LOT of unnecessary additional programming resulting in very poor performance.

Finally, while I do write a lot of ATL/WTL crap, I think MFC is VASTLY superior for creating SINK applications. For example, I can rewrite your entire application in 15 minutes using MFC and create an exe that is 1/3 the size with far better performance by NOT making the exe a COM object itself which just slows down the sink. I have also found it is far better to place all of the sink code in a .lib file for much better performance.

But parts of your code are very well down.



Blush | :O

Bill SerGio
GeneralRe: Serious Design & Coding Problems Pin
Xiaolin Zhang24-Nov-01 4:27
Xiaolin Zhang24-Nov-01 4:27 
GeneralRe: Serious Design & Coding Problems Pin
Bill SerGio24-Nov-01 6:17
Bill SerGio24-Nov-01 6:17 
GeneralRe: Serious Design & Coding Problems Pin
Xiaolin Zhang24-Nov-01 15:59
Xiaolin Zhang24-Nov-01 15:59 
GeneralTo Zhang Pin
ashisht5-Jan-05 23:44
ashisht5-Jan-05 23:44 
GeneralRe: Serious Design & Coding Problems Pin
Fred Ackers4-Jun-02 5:05
Fred Ackers4-Jun-02 5:05 
GeneralRe: Serious Design & Coding Problems Pin
Dirk Clemens16-Jan-02 4:50
Dirk Clemens16-Jan-02 4:50 

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.