home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Elite Hackers Toolkit
/
TheEliteHackersToolkitVolume1_1998.rar
/
HACKERS.BIN
/
appcraks
/
ADCHOICE.ZIP
/
ADCHOICE.CPP
next >
Wrap
C/C++ Source or Header
|
1998-05-04
|
2KB
|
65 lines
#include <windows.h>
BOOL CALLBACK EnumCallback(HWND thiswin,LPARAM buf)
{
LPSTR cbuf=(LPSTR)buf;
GetWindowText(thiswin,cbuf,63);
if(!strcmp(cbuf,"Category Mgr")) {
GetClassName(thiswin,cbuf,63);
return(FALSE);
}
*((LPSTR)buf)=0;
return(TRUE);
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR d3,int nCmdShow)
{
HWND Win0,Win1,AdWin;
RECT pos;
HANDLE hRunStop;
LPCTSTR RunStopMutex="AdChoiceRunStopMutex";
CHAR MatchWindowClass[64];
hRunStop=OpenMutex(MUTEX_ALL_ACCESS,FALSE,RunStopMutex);
if(hRunStop) {
WaitForSingleObject(hRunStop,INFINITE);
Sleep(5000);
ReleaseMutex(hRunStop);
return(0);
}
hRunStop=CreateMutex(NULL,FALSE,RunStopMutex);
AdWin=NULL;
while(WaitForSingleObject(hRunStop,0)==WAIT_OBJECT_0) {
ReleaseMutex(hRunStop);
Win0=FindWindow("PointCastMainWndClass",NULL);
if(Win0) {
EnumChildWindows(Win0,(WNDENUMPROC)EnumCallback,(LPARAM)MatchWindowClass);
if(*MatchWindowClass) {
Win1=NULL;
while(Win1=FindWindowEx(Win0,Win1,MatchWindowClass,NULL)) {
AdWin=NULL;
while(AdWin=FindWindowEx(Win1,AdWin,MatchWindowClass,NULL)) {
if(GetWindowRect(AdWin,&pos)&&
(pos.right-pos.left==240)&&
(pos.bottom-pos.top==160)) {
while(ShowWindow(AdWin,SW_HIDE)) {
Sleep(1000);
if(WaitForSingleObject(hRunStop,0)!=WAIT_OBJECT_0) goto bailout;
ReleaseMutex(hRunStop);
}
goto restart;
}
}
}
}
}
restart:
Sleep(1000);
}
bailout:
if(AdWin) ShowWindow(AdWin,SW_RESTORE);
return(0);
}