Jump to content
xisto Community
Sign in to follow this  
soleimanian

A Simple Popup Ad Remover

Recommended Posts

Copy and paste the code from the text area below to tcboo.c

// Jim Lawless
// jimbo@radiks.net
// http://www.radiks.net/~jimbo/
//
// Simple popup remover for Internet Explorer. Only one
// IEFrame window will be allowed open at any time.

#include <windows.h>
#include <stdio.h>

#pragma comment(lib, "user32.lib")

BOOL CALLBACK enumProc(HWND h,DWORD d);

HINSTANCE hInst;
HWND theWindow=0;

main() {
printf("There can be only one ... IE window.\n");
for(;:) {
EnumWindows((WNDENUMPROC)enumProc,0);
Sleep(1000);
}
}


BOOL CALLBACK enumProc(HWND h,DWORD d) {
char buff[256];
char *p;


GetClassName(h,buff,255);
if(!stricmp(buff,"IEFrame")) {
if(IsWindow(theWindow)&&h!=theWindow) {
GetWindowText(h,buff,254);
printf("Closing %s\n",buff);
MessageBeep(0);
PostMessage(h,WM_CLOSE,0,0L);
}
else {
theWindow=h;
}
}
return TRUE;
}






The above program employs a simple technique to avert popup ads while using Internet Explorer. The program scans all windows once per second looking for all IEFrame windows.

It will only allow one IEFrame window on the screen at a time, which effectively thwarts popup ads.

Share this post


Link to post
Share on other sites

I have used popup ad block software, but I don't use it now. why?I study Business Management in part time, and my school have a website, inform us when take examination in a popup window, last time I missed a examination! as the software blocked the popup window. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.